sotsera / sotsera.blazor.oidc

OpenID Connect client for Blazor client-side projects
https://blazor-oidc.sotsera.com/
Apache License 2.0
20 stars 8 forks source link

Cannot work with Azure AD identity provider #19

Closed imilyutkin closed 10 months ago

imilyutkin commented 4 years ago

When select login usung azure ad exception thrown from page _content/Sotsera.Blazor.Oidc/authentication-popup.html?code=

Sotsera.Blazor.Oidc Popup Authentication Callback Error: Sotsera.Blazor.Oidc.Core.Common.OidcException: Error deserializing the name json to String : The requested operation requires an element of type 'String', but the target element has type 'Array'. at Sotsera.Blazor.Oidc.Utilities.Json.Deserialize[T] (System.Text.Json.JsonElement element, System.String subject) <0x299bec0 + 0x001c4> in :0 at Sotsera.Blazor.Oidc.Core.Common.JsonData.Value[T] (System.String key) <0x2998ee8 + 0x00054> in :0 at Sotsera.Blazor.Oidc.OidcUser.Value[T] (System.String key) <0x2a19858 + 0x0000e> in :0 at Sotsera.Blazor.Oidc.UserExtensions.ToIdentity (Sotsera.Blazor.Oidc.OidcUser user) <0x2582a90 + 0x00060> in :0 at Sotsera.Blazor.Oidc.UserExtensions.ToAuthenticationState (Sotsera.Blazor.Oidc.OidcUser user) <0x2582338 + 0x00004> in :0 at Sotsera.Blazor.Oidc.Core.AuthStateProvider.Notify (Sotsera.Blazor.Oidc.OidcUser user) <0x2a19800 + 0x00006> in :0 at Sotsera.Blazor.Oidc.Core.AuthStateProvider.OnUserChanged (Sotsera.Blazor.Oidc.OidcUser user) <0x2a19660 + 0x00006> in :0 at (wrapper delegate-invoke) System.Action`1[Sotsera.Blazor.Oidc.OidcUser].invoke_void_T(Sotsera.Blazor.Oidc.OidcUser) at Sotsera.Blazor.Oidc.Core.UserManager.UpdateUserState (Sotsera.Blazor.Oidc.Core.Protocol.OpenIdConnect.Model.UserState userState, System.Boolean raiseEvent, System.Boolean updateStore) <0x29c76d8 + 0x0032a> in :0 at Sotsera.Blazor.Oidc.Core.UserManager+<>c__DisplayClass52_0.b__0 () <0x28dee70 + 0x0025e> in :0

ghidello commented 4 years ago

Hi, I've no experience with multiple names in Azure AD: do you have any JWT example to share with multiple names in it? What would be the expected behavior? Picking the first name if the JWT contains an array instead of a string?