I have identity server(IdentityServer4) setup and running as localhost. My client project is AspNet WebForms at this moment. There is another application(javascript) which uses same identity server.
This javascript application calls my webform application and provides accessToken provided via IdentityServer.
Now, I want to call the userInfo endpoint to get openId and profile scope.
I am doing as mentioned in documentation documentation hoping to get userInfo using IdentityModel. But I am not able to get any user info at this point. Below is the sample response from identityserver
Here is the code as mentioned in the documentation
protected void Page_Load(object sender, EventArgs e)
{
var httpclient = new HttpClient();
var token = HttpContext.Current.Request.Headers.Get("Authorization");
var response = httpclient.GetUserInfoAsync(new UserInfoRequest
{
Address = "https://localhost:44367/connect/userinfo",
Token = token
});
if (response.IsFaulted)
{
}
}
Do I somehow also have to provide clientId while making request to identityServer? And, ny idea what is going wrong and how can I get the userInfo from the accessToken.
Please do notice that my client in Asp.Net webform project