Auth0 Google Login to Admin Section of Web App Plus Umbraco CMS in ASP.NET Core

I am experimenting with a .Net core web app that has its own admin section with a social login via Jwt Bearer token using Auth0 (Google authentication).

This was working fine until I added Umbraco CMS to the web app also using Google authentication for the backoffice as per this article:

The Umbraco login works nicely and provides a Sign in with Google button on the login page which auto-links the Umbraco user to the Google account.

My react SPA is also handling the login to an admin section correctly where the user can login with Google and the JWT access token is being returned from Auth0 and then being added to the header for the protected web API calls.

But, the server side authorization of the web API calls does not seem to be handling the JWT bearer token correctly as the user on the context is null so the request is being redirected to the /Account/Login page.

When I remove Umbraco from the web app, the web API calls work fine and the JWT bearer token is being correctly handled by the server with the user being set on the context.

It seems that Umbraco is handling all authorized requests on the server including my web API calls. Does anyone know how to get this working nicely?

I solved this by adding AuthenticationSchemes = JwtBearerDefaults.AuthenticationScheme to the Authorize attribute on the controller.

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