# Send Auth0 token & roles to API from Blazor WebAssembly

**URL:** <https://community.auth0.com/t/send-auth0-token-roles-to-api-from-blazor-webassembly/190234>\
**Category:** Get Help\
**Tags:** apis, application\
**Created:** [August 6, 2025, 10:05am UTC](https://community.auth0.com/t/send-auth0-token-roles-to-api-from-blazor-webassembly/190234 "2025-08-06T10:05:50Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![d.zardi](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/d.zardi/32/71415_2.png) [@d.zardi](https://community.auth0.com/u/d.zardi)\
**Post date:** [August 6, 2025, 10:05am UTC](https://community.auth0.com/t/send-auth0-token-roles-to-api-from-blazor-webassembly/190234/1 "2025-08-06T10:05:50Z")

</div>

Hi!  
I’ve developed a “pure” Blazor WebAssembly app (without Blazor Server) and an MVC API. The WebAssembly app should authenticate with Auth0 and send HTTP client requests to the external API, passing along Auth0’s access token and user roles.  
I don’t understand how to do this without a Blazor Server, or even if it’s possible.

---

<div class="post-metadata">

**Author:** ![Leota440John](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/leota440john/32/75890_2.png) [@Leota440John](https://community.auth0.com/u/Leota440John)\
**Post date:** [August 6, 2025, 11:13am UTC](https://community.auth0.com/t/send-auth0-token-roles-to-api-from-blazor-webassembly/190234/2 "2025-08-06T11:13:38Z")

</div>

Yes, it is absolutely possible to build a “pure” Blazor WebAssembly app that authenticates with Auth0 and securely calls an external MVC API. This is a very common and recommended architecture. You do not need Blazor Server to achieve this.

The key is to handle the authentication flow entirely on the client side and then configure your API to validate the tokens that the client sends.

---

<div class="post-metadata">

**Author:** ![d.zardi](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/d.zardi/32/71415_2.png) [@d.zardi](https://community.auth0.com/u/d.zardi)\
**Post date:** [August 6, 2025, 1:41pm UTC](https://community.auth0.com/t/send-auth0-token-roles-to-api-from-blazor-webassembly/190234/3 "2025-08-06T13:41:27Z")

</div>

Thank you for your reply!  
Could you please share an example code of the http client configuration in the program.cs of the WebAssembly app?

I’ve tried the following but it doesn’t work as expected, since the token doesn’t arrive to the API.

```auto
builder.Services.AddHttpClient("ServerAPI",
    client => client.BaseAddress = new Uri("UriApi"))
  .AddHttpMessageHandler<BaseAddressAuthorizationMessageHandler>();
 
builder.Services.AddScoped(sp => sp.GetRequiredService<IHttpClientFactory>()
  .CreateClient("ServerAPI"));

```
