IdentityModel / IdentityModel.OidcClient.Old

OpenID Connect Client Library for Native Applications
Other
38 stars 17 forks source link

OidcClient.LoginAsync result #59

Closed dpedrelli closed 7 years ago

dpedrelli commented 7 years ago

Hi,

If I use the WinFormsWebView sample app, with the default authority "https://demo.identityserver.io," the result returns: AccessToken, Claims, Handler, IdentityToken (matches AccessToken), RefreshToken, SecordsBeforeRenew, and Success = true. Only Error is null. That is followed by instantiating _apiClient = new HttpClient(result.Handler); I am able to make the API call, successfully.

If I change the authority to IdentityServer4.Samples IdentityServerWithAspNetIdentity QuickStart, the login is successful. It returns values for AccessToken, Claims, IdentityToken (matches AccessToken), SecordsBeforeRenew, and Success = true. However, Handler and RefreshToken are both null. I have to instantiate new HttpClient(), without the handler. When I make the API call, I get an internal server error. I assume this is because I am not passing the token back to the server.

Should LoginAsync() return a Handler and RefreshToken? If so, how can I remedy this? If not, what do I need to do to manually add the token to my API call?

Thanks

leastprivilege commented 7 years ago

It only returns a handler and refresh token if the offline_access scope was requested.

btw - You might want to give v2 a try - Once this is out I only want to support the newer version https://github.com/IdentityModel/IdentityModel.OidcClient2

dpedrelli commented 7 years ago

I'll try migrating to v2. Thanks