# Failed Silent Auth in Blazor Wasm application

**URL:** <https://community.auth0.com/t/failed-silent-auth-in-blazor-wasm-application/154668>\
**Category:** Get Help\
**Tags:** new-universal-login-experience, login-experience\
**Created:** [November 27, 2024, 8:33pm UTC](https://community.auth0.com/t/failed-silent-auth-in-blazor-wasm-application/154668 "2024-11-27T20:33:12Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![chase-cannect](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/chase-cannect/32/33365_2.png) [@chase-cannect](https://community.auth0.com/u/chase-cannect)\
**Post date:** [November 27, 2024, 8:33pm UTC](https://community.auth0.com/t/failed-silent-auth-in-blazor-wasm-application/154668/1 "2024-11-27T20:33:12Z")

</div>

My Blazor Wasm application was running fine until a couple of weeks ago whereby I updated to .NET9.0 and likely also updated browers and such. Now I can’t authenticate, getting a NullReferenceException against the `RemoteUserAccount` in my `AccountClaimsPrincipalFactory`.

 ![image](https://global.discourse-cdn.com/auth0/original/3X/2/c/2c834c895f046c267936d7e736745919679ddd24.png)

 ![image](https://global.discourse-cdn.com/auth0/original/3X/c/0/c0fd1f5e2f31d6886bbc26bb714e2fc117df05d4.jpeg)

Upon investigation, I’ve noticed a `Failed Silent Auth` fills my Auth0 logs, and I’m not sure where to even begin looking.

note: I’ve noticed a new message in Chrome, but I don’t think this is the root of the issue, but it’s an observation none the less

> Chrome is moving towards a new experience that allows users to choose to browse without third-party cookies.

Here is a redacted version of my appsettings

 ![image](https://global.discourse-cdn.com/auth0/original/3X/6/9/69136fa31f13a0b32535c04e10004bdd39e058c0.png)

I setup my Oicd config as follows

```csharp
	private static void ConfigureOidcAuthentication(WebAssemblyHostBuilder builder,
	                                                RemoteAuthenticationOptions<OidcProviderOptions> options)
	{
		builder.Configuration.Bind("Auth0", options.ProviderOptions);
		options.UserOptions.RoleClaim = builder.Configuration["Auth0:CustomClaimsSchema"] + "/roles";
		options.ProviderOptions.AdditionalProviderParameters.Add("audience", builder.Configuration["Auth0:Audience"]);
		options.ProviderOptions.ResponseType = "code";
	}

```

And I use an HttpRetryHandler to attempt token refresh, but as far as I can tell, the system doesn’t even get far enough to try a refresh.

```csharp
	public async Task RefreshAccessToken()
	{
		var refreshUri = new Uri(_configuration.GetValue<string>(WellKnownConfigurationNames.Auth0.Authority));

		using var content = new MultipartFormDataContent();

		content.Add(new StringContent(WellKnownMultipartFormDataNames.REFRESH_TOKEN), WellKnownMultipartFormDataNames.GRANT_TYPE);
		content.Add(new StringContent(_configuration.GetValue<string>(WellKnownConfigurationNames.Auth0.ClientId)), WellKnownMultipartFormDataNames.CLIENT_ID);
		content.Add(new StringContent(await _storageService.GetRefreshToken().ConfigureAwait(false)), WellKnownMultipartFormDataNames.REFRESH_TOKEN);

		using var request = new HttpRequestMessage(HttpMethod.Post, refreshUri);
		request.Content = content;
		request.Headers.AddHeader(WellKnownHttpHeaders.CONTENT_TYPE, WellKnownDataContentMediaTypes.FormUrlEncoded);

		await _httpClient().SendAsync(request).ConfigureAwait(false);
	}

```

For the sake of completeness, here is one of the failed log messages

```json
{
  "date": "2024-11-27T20:01:00.896Z",
  "type": "fsa",
  "description": "Login required",
  "client_id": "--redacted--",
  "client_name": "--redacted--portal",
  "ip": "--redacted--",
  "user_agent": "Chrome 131.0.0 / Mac OS X 10.15.7",
  "details": {
    "body": {},
    "qs": {
      "client_id": "--redacted--",
      "redirect_uri": "https://localhost:5000/auth/login-callback",
      "response_type": "code",
      "scope": "openid profile email offline_access",
      "state": "--redacted--",
      "code_challenge": "--redacted---v7E-62Ihh0",
      "code_challenge_method": "S256",
      "prompt": "none",
      "response_mode": "query",
      "audience": "https://--redacted--.app"
    },
    "connection": null,
    "error": {
      "message": "Login required",
      "oauthError": "login_required",
      "type": "oauth-authorization"
    },
    "riskAssessment": null
  },
  "hostname": "--redacted--.us.auth0.com",
  "audience": "https://--redacted--.app",
  "scope": [
    "openid",
    "profile",
    "email",
    "offline_access"
  ],
  "$event_schema": {
    "version": "1.0.0"
  },
  "log_id": "--redacted--",
  "tenant_name": "--redacted---test",
  "_id": "--redacted--",
  "isMobile": false,
  "originalData": {
    "date": "2024-11-27T20:01:00.896Z",
    "type": "fsa",
    "description": "Login required",
    "client_id": "--redacted--",
    "client_name": "--redacted---portal",
    "ip": "--redacted--",
    "user_agent": "Chrome 131.0.0 / Mac OS X 10.15.7",
    "details": {
      "body": {},
      "qs": {
        "client_id": "--redacted--",
        "redirect_uri": "https://localhost:5000/auth/login-callback",
        "response_type": "code",
        "scope": "openid profile email offline_access",
        "state": "--redacted--",
        "code_challenge": "--redacted---v7E-62Ihh0",
        "code_challenge_method": "S256",
        "prompt": "none",
        "response_mode": "query",
        "audience": "https://--redacted--.app"
      },
      "connection": null,
      "error": {
        "message": "Login required",
        "oauthError": "login_required",
        "type": "oauth-authorization"
      },
      "riskAssessment": null
    },
    "hostname": "--redacted--.us.auth0.com",
    "audience": "https://--redacted--.app",
    "scope": [
      "openid",
      "profile",
      "email",
      "offline_access"
    ],
    "$event_schema": {
      "version": "1.0.0"
    },
    "log_id": "--redacted--",
    "tenant_name": "--redacted---test",
    "_id": "--redacted--",
    "isMobile": false
  },
  "integrityRuleset": {},
  "id": "--redacted--"
}

```

 ![image](https://global.discourse-cdn.com/auth0/original/3X/5/a/5a1249fa55017607ebb49aa1430f2e64f693107a.png)

Any assistance on getting to the bottom of this would be greatly appreciated

---

<div class="post-metadata">

**Author:** ![rueben.tiow](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/rueben.tiow/32/11646_2.png) [@rueben.tiow](https://community.auth0.com/u/rueben.tiow)\
**Post date:** [December 3, 2024, 1:29am UTC](https://community.auth0.com/t/failed-silent-auth-in-blazor-wasm-application/154668/3 "2024-12-03T01:29:19Z")

</div>

Hi @chase-cannect,

The failed silent auth error message is indicating you are trying to authenticate with the `prompt=none` query parameter but there isn’t an active session previously. Typically silent auth is used to re-authenticate without user interaction, and since there isnt an existing session, the error is thrown. This is justified by your Auth0 logs indicating a “Login required” error description. You can authenticate as usual by removing the `prompt=none` scope and then include it back in future requests.

Secondly, the Chrome deprecation warning about not using third-party cookies will require you to use either custom domains or [Refresh Token Rotation](https://auth0.com/docs/secure/tokens/refresh-tokens/refresh-token-rotation) to get new access tokens. (Reference: [Third-party cookie deprecation in Chrome - #6 by tyf](https://community.auth0.com/t/third-party-cookie-deprecation-in-chrome/122836/6))

Thanks,  
Rueben

---

<div class="post-metadata">

**Author:** ![chase-cannect](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/chase-cannect/32/33365_2.png) [@chase-cannect](https://community.auth0.com/u/chase-cannect)\
**Post date:** [December 3, 2024, 6:58pm UTC](https://community.auth0.com/t/failed-silent-auth-in-blazor-wasm-application/154668/4 "2024-12-03T18:58:07Z")

</div>

Thank you for taking the time to answer.

I already had Refresh Tokens turned on, and I removed the default scope as you suggested, and after testing by removing `offline_access`, I got the same response.

---

<div class="post-metadata">

**Author:** ![rueben.tiow](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/rueben.tiow/32/11646_2.png) [@rueben.tiow](https://community.auth0.com/u/rueben.tiow)\
**Post date:** [December 3, 2024, 11:35pm UTC](https://community.auth0.com/t/failed-silent-auth-in-blazor-wasm-application/154668/5 "2024-12-03T23:35:53Z")

</div>

Hi @chase-cannect,

Thanks for the update.

I corrected my previous reply because the `offline_accces` scope is actually meant for getting refresh tokens.

I have just checked your logs and found that you were still performing silent auth, which happens when calling the `prompt=none` query parameter. Could you omit that query parameter and try again and let me know how it goes?  
(Reference: [Configure Silent Authentication](https://auth0.com/docs/authenticate/login/configure-silent-authentication))

Thanks,  
Rueben

---

<div class="post-metadata">

**Author:** ![chase-cannect](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/chase-cannect/32/33365_2.png) [@chase-cannect](https://community.auth0.com/u/chase-cannect)\
**Post date:** [December 4, 2024, 3:12pm UTC](https://community.auth0.com/t/failed-silent-auth-in-blazor-wasm-application/154668/6 "2024-12-04T15:12:39Z")

</div>

I’ve enabled a custom domain in my app in hopes of getting around this. I’m not sure how to disable the `prompt=none` since it is added by Blazor Wasm. Still digging…

---

<div class="post-metadata">

**Author:** ![rueben.tiow](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/rueben.tiow/32/11646_2.png) [@rueben.tiow](https://community.auth0.com/u/rueben.tiow)\
**Post date:** [December 4, 2024, 11:38pm UTC](https://community.auth0.com/t/failed-silent-auth-in-blazor-wasm-application/154668/7 "2024-12-04T23:38:23Z")

</div>

Hi @chase-cannect,

Thanks for the reply.

It looks like the Blazor Wasm uses the [Auth0 ASP.NET Core Authentication SDK](https://github.com/auth0/auth0-aspnetcore-authentication). You could check the [`LoginParameters`](https://auth0.github.io/auth0-aspnetcore-authentication/api/Auth0.AspNetCore.Authentication.Auth0WebAppOptions.html#Auth0_AspNetCore_Authentication_Auth0WebAppOptions_LoginParameters) to find the `prompt=none` query parameter.

Alternatively, you can search your code base for the `prompt=none` query parameter to find where this setting is configured.

Thanks,  
Rueben

---

<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:** [December 18, 2024, 11:39pm UTC](https://community.auth0.com/t/failed-silent-auth-in-blazor-wasm-application/154668/8 "2024-12-18T23:39:06Z")

</div>

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