IdentityModel.OidcClient icon indicating copy to clipboard operation
IdentityModel.OidcClient copied to clipboard

OidcClient throwing Unauthorized error after upgrade from 3.1.2 to 5.0.2

Open kavitap0810 opened this issue 2 years ago • 1 comments

Hi,

In my application, we are using OidcClient to connect with Google account. It was working fine with version 3.1.2. After upgrading to 5.0.2, ResponseMode and Flow is no more available so commented it but now its giving response "Error contacting userinfo endpoint: Unauthorized" .

Code for Auth configuration :

    OidcClientOptions oidcClientOptions = new OidcClientOptions
            {
                Authority = GoogleFitConfiguration.AuthorizeUrl,
                ClientId =  GoogleFitConfig.AndroidClientId,
                Scope = GoogleFitConfiguration.ActivityScope,
                
                RedirectUri = GoogleFitConfig.AndroidRedirectUrl,
                Browser = IoCRegistry.Locate<IBrowser>(),
                //Flow = OidcClientOptions.AuthenticationFlow.Hybrid,  
                //ResponseMode = OidcClientOptions.AuthorizeResponseMode.Redirect, 
                Policy = new Policy
                {
                    Discovery = discovery,
                    RequireAccessTokenHash = false 
                }
            };

Using above params , OidcClient object(say "oidcClientObj") is created and then loginRequest is executed using await oidcClientObj.LoginAsync(new LoginRequest()) -> this opens the google login page -> user enters credentials -> "Allow" permission -> getting UnAuthrorized error response.

Note - Using this in Xamarin application. Can you please let me know what has changed between 3.1.2 to 5.0.2 and what new changes needs to be done in order to handle this error

kavitap0810 avatar Aug 25 '22 16:08 kavitap0810

did you check your server error logs?

leastprivilege avatar Sep 18 '22 06:09 leastprivilege

Same here: image image

0andy avatar Oct 05 '22 15:10 0andy

did you check your server error logs?

leastprivilege avatar Oct 05 '22 17:10 leastprivilege