robertino.calcaterra Auth0 Employee
How did you like this post? Please share any comments or feedback with us on this thread
How did you like this post? Please share any comments or feedback with us on this thread
The GitHub files have been deleted so there’s some work on going into the pull history to get the needed code.
1 replyHi @sfernandez,
Sorry, I’m not sure what GitHub files are referring to
As far as I can see, the sample project looks ok. Am I missing something?
@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 replyHey @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
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 replyIs 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 replyHey @adam16,
I have it in my plan but I can’t say when it will happen due to other priorities at the moment.
Maybe this article can help?
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…”
Awesome! Thank you for your feedback
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.
I’m sorry to hear that you have not been able to get a working Blazor MAUI app following this article.
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
Thank you very much. That would be greatly appreciated.
Hi @adam16,
I plan to work on it in the next couple of weeks. Stay tuned!
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)
Thank you very much!
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 replyThe code provided in this article is for .NET 8.0. It has not been tested with .NET 9.0
1 replyCool! Thank you for sharing
So this means it’s working in .NET 9 as well, right?
Yes it does as long as you don’t forget the cascading authentication state
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 replyHey @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)