Continue Discussion 30 replies
February 2023

robertino.calcaterra Auth0 Employee

How did you like this post? Please share any comments or feedback with us on this thread

February 2024

sfernandez

The GitHub files have been deleted so there’s some work on going into the pull history to get the needed code.

1 reply
February 2024 ▶ sfernandez

andrea.chiarelli Auth0 Employee

Hi @sfernandez,
Sorry, I’m not sure what GitHub files are referring to :thinking:
As far as I can see, the sample project looks ok. Am I missing something?

March 2024

danilo.vetturini

@andrea.chiarelli , in the hyperlink text ‘this GitHub repo.’ linked to this sentence, it leads to a wrong link: https://github.com/auth0-blog/dotnet-maui-auth0-app/tree/main/Auth0, but the one you put in the comments works: dotnet-blazor-maui-auth0-app/Auth0 at main · auth0-blog/dotnet-blazor-maui-auth0-app · GitHub.

1 reply
March 2024 ▶ danilo.vetturini

andrea.chiarelli Auth0 Employee

Hey @danilo.vetturini,
Welcome to the Auth0 community!

You are right, the link in the article is no longer working because it refers to a previous version of the repo. Thank you for reporting :pray:

I’m in the process of updating the current MAUI content because now we have a MAUI SDK, which simplifies significantly the code. This article still uses the previous approach and, as said, points to a repo that has been updated.
I have temporarily fixed the link now, but I plan to update the article in about a week or so.

Stay tuned!

1 reply
April 2024 ▶ andrea.chiarelli

adam16

Hello, is there an updated version of this article for .NET 8 available?

2 replies
April 2024

adam16

Is it possible to remember credentials and have the user automatically logged in on start-up? This is how it works in the iOS Native app using Auth0. Using this method I have to click Log-in and then hit “Continue” to allow it to sign in. I don’t have to retype my credentials again, but I would like to remove those two extra steps for users of my app.

1 reply
April 2024 ▶ adam16

andrea.chiarelli Auth0 Employee

Hey @adam16,
I have it in my plan but I can’t say when it will happen due to other priorities at the moment.

April 2024 ▶ adam16

andrea.chiarelli Auth0 Employee

Maybe this article can help?

May 2024 ▶ adam16

bocarmg23

Yeah it works with .net 8 i just tested it. just follow the article and don’t FORGET to add platform specific code
like the WebAuthenticationCallbackActivity for android and the others.
otherwise you will get error like: “You must subclass your WebAuthenticationCallbackActivityAn etc…”

1 reply
May 2024 ▶ bocarmg23

andrea.chiarelli Auth0 Employee

Awesome! Thank you for your feedback :raised_hands:

June 2024

Al4ric

I have tried to follow up this article, but I just cannot make it work with current Maui Blazor template. Apart from some things like non-existing “Main.razor” file there are other issues. I cannot find any mention here about “myapp” protocol and even after adding changes for this from other article (the one for Maui but without Blazor component) other issues arise.

It would be fantastic to have at least working example of current Maui Blazor application working with Auth0. Current state seems to be a lot of different places on your website - some of them are needed to be combined, other are contradictory or unclear. I have been trying to add Authentication for the simplest Maui Blazor app with those article and after a week - I have nothing that would be close to working. :frowning:

1 reply
June 2024 ▶ Al4ric

andrea.chiarelli Auth0 Employee

I’m sorry to hear that you have not been able to get a working Blazor MAUI app following this article. :slightly_frowning_face:
Unfortunately, it is based on .NET 7 and has not been updated to use the new Auth0 SDK, so I understand that it turns out to be very confusing in combination with the other articles.

There are plans to update this article, but right now I can’t say when that will happen.
I’ll ping you as soon as an updated version is published.
Sorry for the inconvenience and thanks for bringing this up :pray:

1 reply
June 2024 ▶ andrea.chiarelli

Al4ric

Thank you very much. That would be greatly appreciated.

July 2024

adam16

I see that there is a “This article is out of date” disclaimer at the top now. Any time line on when this will be updated?

1 reply
July 2024 ▶ adam16

andrea.chiarelli Auth0 Employee

Hi @adam16,
I plan to work on it in the next couple of weeks. Stay tuned!

August 2024

andrea.chiarelli Auth0 Employee

This article has been updated to .NET 8 and now it uses the Auth0 .NET OIDC Client for MAUI SDK.

(cc: @adam16, @Al4ric, @bocarmg23, @danilo.vetturini)

August 2024

Al4ric

Thank you very much!

December 2024

sebastien.desalvador

Hi, is this still up to date? I have tried with the new .NET 9 templates and it doesn’t seem to load, I get a white screen with “Loading…” at the top.

1 reply
December 2024 ▶ sebastien.desalvador

andrea.chiarelli Auth0 Employee

The code provided in this article is for .NET 8.0. It has not been tested with .NET 9.0

1 reply
December 2024 ▶ andrea.chiarelli

sebastien.desalvador

Nevermind, I was missing AddCascadingAuthenticationState().

1 reply
December 2024 ▶ sebastien.desalvador

andrea.chiarelli Auth0 Employee

Cool! Thank you for sharing :slightly_smiling_face:
So this means it’s working in .NET 9 as well, right?

December 2024

sebastien.desalvador

Yes it does as long as you don’t forget the cascading authentication state :slight_smile:

1 reply
January 8

dsapo

Hello Andrea, thanks for the article.

I only have one question related to the Blazor Web project. My Maui solution has 3 projects, the mobile the shared project and the web project (Blazor WASM). Currently only the Mobile works, but when I run the web I am getting error:

rit: Microsoft.AspNetCore.Components.WebAssembly.Rendering.WebAssemblyRenderer[100]
Unhandled exception rendering component: Could not load type of field ‘Auth0.OidcClient.WebAuthenticatorBrowser+d__0:<>u__1’ (3) due to: Could not load file or assembly ‘Microsoft.Maui.Essentials, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null’ or one of its dependencies.
System.TypeLoadException: Could not load type of field ‘Auth0.OidcClient.WebAuthenticatorBrowser+d__0:<>u__1’ (3) due to: Could not load file or assembly 'Microsoft.Maui.Essentials, Version=1.0.0.0

In order to make the authentication to work for the web project on Blazor WebAssembly should I do the implemention with the traditional approach for Blazor WASM ? or there is a way to use the same logic for all ?

Thanks

1 reply
January 10 ▶ dsapo

andrea.chiarelli Auth0 Employee

Hey @dsapo,
You can’t use the MAUI SDK in a Blazor WASM app.
A Blazor WASM app is still a web app, not a native app. You should use the approaches described here or here (it depends on the .NET version and/or the hosting model)