ASP.NET application interoperates with another service with access token. That token we retrieve from login screen.
The problem is that some web service operations (in ASP.NET) have to use special user whose credentials we read from config.
I'm looking for a silent way to get access token for this user, but I am new to IDP stuff and can't seem to figure out url parameters for that.
I set prompt=none. I also don't think I need returnUrl, but Idp service isn't happy when ommiting returnUrl parameter.
var authorizeBehindTheSceneUrl = https://localhost/MyIdentityServer/connect/authorize?client_id=MyAppId&response_type=id_token+token&scope=openid+email&redirect_uri=http%3A%2F%2Flocalhost%2FsomeCallback.aspx&state=eyJVcmwiOiJodHR&nonce=3b119c54c48f9b8673&acr_values=idp%3A&prompt=none
And I would like to write something like:
using(var client = new WebClient())
{
var response = client.DownloadString(authorizeBehindTheSceneUrl);
// Do json parsing of response and retrieve clams
}
From straightforward code above you can see that I don't expect any user interaction, redirection.
Could anyone propose url structure to achieve what I need? What parameter I should use to pass credentials? "state"?