# An error occurred during login: sub claim is missing from userinfo endpoint

**URL:** <https://community.auth0.com/t/an-error-occurred-during-login-sub-claim-is-missing-from-userinfo-endpoint/59128>\
**Category:** Get Help\
**Tags:** oidc, login\
**Created:** [March 9, 2021, 3:35pm UTC](https://community.auth0.com/t/an-error-occurred-during-login-sub-claim-is-missing-from-userinfo-endpoint/59128 "2021-03-09T15:35:27Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![msavard](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/msavard/32/14222_2.png) [@msavard](https://community.auth0.com/u/msavard)\
**Post date:** [March 9, 2021, 3:35pm UTC](https://community.auth0.com/t/an-error-occurred-during-login-sub-claim-is-missing-from-userinfo-endpoint/59128/1 "2021-03-09T15:35:27Z")

</div>

IdentityModel.OidcClient version: 4.0.0-preview.7 and lower same problem too  
WinForm .Net 5.0

In Auth0ClientBase.cs, when I call  
var result = await OidcClient.LoginAsync(loginRequest, cancellationToken);  
I always receive the error: “An error occurred during login: sub claim is missing from userinfo endpoint”

----- OidcClient -------

| - | | OidcClient | {IdentityModel.OidcClient.OidcClient} | IdentityModel.OidcClient.OidcClient |
| --- | --- | --- | --- | --- |
| - | | Options | {IdentityModel.OidcClient.OidcClientOptions} | IdentityModel.OidcClient.OidcClientOptions |
| | | Authority | “https://\*\*\*\*\*\*\*\*\*\*\*\*.us.auth0.com” | string |
| | | BackchannelHandler | null | System.Net.Http.HttpMessageHandler |
| + | | BackchannelTimeout | {00:00:30} | System.TimeSpan |
| + | | Browser | {Auth0.OidcClient.WebViewBrowser} | IdentityModel.OidcClient.Browser.IBrowser {Auth0.OidcClient.WebViewBrowser} |
| + | | BrowserTimeout | {00:00:00} | System.TimeSpan |
| + | | ClientAssertion | {IdentityModel.Client.ClientAssertion} | IdentityModel.Client.ClientAssertion |
| | | ClientId | “\*\*\*\*\*\*\*\*\*\*\*\*” | string |
| | | ClientSecret | null | string |
| + | | ClockSkew | {00:05:00} | System.TimeSpan |
| | | FilterClaims | true | bool |
| - | | FilteredClaims | Count = 10 | System.Collections.Generic.ICollection {System.Collections.Generic.HashSet} |
| | | [0] | “iss” | string |
| | | [1] | “exp” | string |
| | | [2] | “nbf” | string |
| | | [3] | “aud” | string |
| | | [4] | “nonce” | string |
| | | [5] | “iat” | string |
| | | [6] | “auth\_time” | string |
| | | [7] | “c\_hash” | string |
| | | [8] | “at\_hash” | string |
| | | [9] | “s\_hash” | string |
| + | | Raw View | | |
| | | IdentityTokenValidator | null | IdentityModel.OidcClient.IIdentityTokenValidator |
| | | LoadProfile | true | bool |
| + | | LoggerFactory | {Microsoft.Extensions.Logging.LoggerFactory} | Microsoft.Extensions.Logging.ILoggerFactory {Microsoft.Extensions.Logging.LoggerFactory} |
| - | | Policy | {IdentityModel.OidcClient.Policy} | IdentityModel.OidcClient.Policy |
| + | | Discovery | {IdentityModel.Client.DiscoveryPolicy} | IdentityModel.Client.DiscoveryPolicy |
| | | RequireAccessTokenHash | false | bool |
| | | RequireIdentityTokenOnRefreshTokenResponse | false | bool |
| | | RequireIdentityTokenSignature | true | bool |
| - | | ValidSignatureAlgorithms | Count = 7 | System.Collections.Generic.ICollection {System.Collections.Generic.HashSet} |
| | | [0] | “RS256” | string |
| | | [1] | “RS384” | string |
| | | [2] | “RS512” | string |
| | | [3] | “PS256” | string |
| | | [4] | “PS384” | string |
| | | [5] | “PS512” | string |
| | | [6] | “ES256” | string |
| + | | Raw View | | |
| | | ValidateTokenIssuerName | true | bool |
| | | PostLogoutRedirectUri | “https://\*\*\*\*\*\*\*\*\*\*\*\*.us.auth0.com/mobile” | string |
| | | ProviderInformation | null | IdentityModel.OidcClient.ProviderInformation |
| | | RedirectUri | “https://\*\*\*\*\*\*\*\*\*\*\*\*.us.auth0.com/mobile” | string |
| | | RefreshDiscoveryDocumentForLogin | true | bool |
| | | RefreshDiscoveryOnSignatureFailure | false | bool |
| | | RefreshTokenInnerHttpHandler | null | System.Net.Http.HttpMessageHandler |
| + | | Resource | Count = 0 | System.Collections.Generic.ICollection {System.Collections.Generic.HashSet} |
| | | Scope | “openid profile email” | string |
| | | TokenClientCredentialStyle | PostBody | IdentityModel.Client.ClientCredentialStyle |
| - | | \_authorizeClient | {IdentityModel.OidcClient.AuthorizeClient} | IdentityModel.OidcClient.AuthorizeClient |
| + | | \_crypto | {IdentityModel.OidcClient.CryptoHelper} | IdentityModel.OidcClient.CryptoHelper |
| + | | \_logger | {Microsoft.Extensions.Logging.Logger\<IdentityModel.OidcClient.AuthorizeClient\>} | Microsoft.Extensions.Logging.ILogger\<IdentityModel.OidcClient.AuthorizeClient\> {Microsoft.Extensions.Logging.Logger\<IdentityModel.OidcClient.AuthorizeClient\>} |
| + | | \_options | {IdentityModel.OidcClient.OidcClientOptions} | IdentityModel.OidcClient.OidcClientOptions |
| - | | \_logger | {Microsoft.Extensions.Logging.Logger\<IdentityModel.OidcClient.OidcClient\>} | Microsoft.Extensions.Logging.ILogger {Microsoft.Extensions.Logging.Logger\<IdentityModel.OidcClient.OidcClient\>} |
| + | | \_logger | {Microsoft.Extensions.Logging.Logger} | Microsoft.Extensions.Logging.ILogger {Microsoft.Extensions.Logging.Logger} |
| - | | \_processor | {IdentityModel.OidcClient.ResponseProcessor} | IdentityModel.OidcClient.ResponseProcessor |
| + | | \_crypto | {IdentityModel.OidcClient.CryptoHelper} | IdentityModel.OidcClient.CryptoHelper |
| + | | \_logger | {Microsoft.Extensions.Logging.Logger\<IdentityModel.OidcClient.ResponseProcessor\>} | Microsoft.Extensions.Logging.ILogger\<IdentityModel.OidcClient.ResponseProcessor\> {Microsoft.Extensions.Logging.Logger\<IdentityModel.OidcClient.ResponseProcessor\>} |
| - | | \_options | {IdentityModel.OidcClient.OidcClientOptions} | IdentityModel.OidcClient.OidcClientOptions |
| | | Authority | “https://\*\*\*\*\*\*\*\*\*\*\*\*.us.auth0.com” | string |
| | | BackchannelHandler | null | System.Net.Http.HttpMessageHandler |
| + | | BackchannelTimeout | {00:00:30} | System.TimeSpan |
| + | | Browser | {Auth0.OidcClient.WebViewBrowser} | IdentityModel.OidcClient.Browser.IBrowser {Auth0.OidcClient.WebViewBrowser} |
| + | | BrowserTimeout | {00:00:00} | System.TimeSpan |
| + | | ClientAssertion | {IdentityModel.Client.ClientAssertion} | IdentityModel.Client.ClientAssertion |
| | | ClientId | “\*\*\*\*\*\*\*\*\*\*\*\*” | string |
| | | ClientSecret | null | string |
| + | | ClockSkew | {00:05:00} | System.TimeSpan |
| | | FilterClaims | true | bool |
| + | | FilteredClaims | Count = 10 | System.Collections.Generic.ICollection {System.Collections.Generic.HashSet} |
| | | IdentityTokenValidator | null | IdentityModel.OidcClient.IIdentityTokenValidator |
| | | LoadProfile | true | bool |
| + | | LoggerFactory | {Microsoft.Extensions.Logging.LoggerFactory} | Microsoft.Extensions.Logging.ILoggerFactory {Microsoft.Extensions.Logging.LoggerFactory} |
| + | | Policy | {IdentityModel.OidcClient.Policy} | IdentityModel.OidcClient.Policy |
| | | PostLogoutRedirectUri | “https://\*\*\*\*\*\*\*\*\*\*\*\*.us.auth0.com/mobile” | string |
| | | ProviderInformation | null | IdentityModel.OidcClient.ProviderInformation |
| | | RedirectUri | “https://\*\*\*\*\*\*\*\*\*\*\*\*.us.auth0.com/mobile” | string |
| | | RefreshDiscoveryDocumentForLogin | true | bool |
| | | RefreshDiscoveryOnSignatureFailure | false | bool |
| | | RefreshTokenInnerHttpHandler | null | System.Net.Http.HttpMessageHandler |
| + | | Resource | Count = 0 | System.Collections.Generic.ICollection {System.Collections.Generic.HashSet} |
| | | Scope | “openid profile email” | string |
| | | TokenClientCredentialStyle | PostBody | IdentityModel.Client.ClientCredentialStyle |
| + | | \_refreshKeysAsync | {Method = {System.Threading.Tasks.Task EnsureProviderInformationAsync(System.Threading.CancellationToken)}} | System.Func\<System.Threading.CancellationToken, System.Threading.Tasks.Task\> |
| | | \_useDiscovery | true | bool |

---

<div class="post-metadata">

**Author:** ![msavard](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/msavard/32/14222_2.png) [@msavard](https://community.auth0.com/u/msavard)\
**Post date:** [March 9, 2021, 8:46pm UTC](https://community.auth0.com/t/an-error-occurred-during-login-sub-claim-is-missing-from-userinfo-endpoint/59128/2 "2021-03-09T20:46:16Z")

</div>

I found the mistake. I have a custom rules and this Rules change my claims

---

<div class="post-metadata">

**Author:** ![stephanie.chamblee](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/stephanie.chamblee/32/26087_2.png) [@stephanie.chamblee](https://community.auth0.com/u/stephanie.chamblee)\
**Post date:** [March 9, 2021, 8:48pm UTC](https://community.auth0.com/t/an-error-occurred-during-login-sub-claim-is-missing-from-userinfo-endpoint/59128/3 "2021-03-09T20:48:39Z")

</div>

Hi @msavard,

I’m glad you were able to find the rule that was causing the issue!

---

<div class="post-metadata">

**Author:** ![msavard](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/msavard/32/14222_2.png) [@msavard](https://community.auth0.com/u/msavard)\
**Post date:** [March 9, 2021, 9:04pm UTC](https://community.auth0.com/t/an-error-occurred-during-login-sub-claim-is-missing-from-userinfo-endpoint/59128/4 "2021-03-09T21:04:46Z")

</div>

Yes, but for find the mistake, a convert completly in .Net5

auth0-WinFormsWPF-oidc-samples-master with replace webbrowser in DLL with the real WebBrowser in System.Windows.Forms

And I find your Nuget source code in your Git repository for:  
IdentityTokenValidator  
OidcClient

Ok for me, but not really easy for beginner

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [March 24, 2021, 9:05pm UTC](https://community.auth0.com/t/an-error-occurred-during-login-sub-claim-is-missing-from-userinfo-endpoint/59128/5 "2021-03-24T21:05:10Z")

</div>

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.
