Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Web authenticator with MAUI (.NET 8): too many redirections #2014

Closed
erossini opened this issue Jan 16, 2024 · 1 comment
Closed

Web authenticator with MAUI (.NET 8): too many redirections #2014

erossini opened this issue Jan 16, 2024 · 1 comment
Labels

Comments

@erossini
Copy link

Type of issue

Other (describe below)

Description

I'm trying to use the Web authenticator in a MAUI project built with .NET 8. I followed the Microsoft documentation.

I created the API using the code from the documentation and published it on a public website. Then, I configured the MAUI app following the documentation.

The result is when I try to log in with Microsoft (the only provider I was trying), the first time I have been asked to insert my Microsoft account. Although I closed the app and reopen it, then I tried to log in, I got an error "too many redirections" as you see in the following screenshot.

enter image description here

I saw this post but it is not clear to me what the fix is. Plus, from the documentation, the Web authenticator doesn't work with Windows. DO you know if there is any workaround?

Page URL

https://learn.microsoft.com/en-us/dotnet/maui/platform-integration/communication/authentication?view=net-maui-8.0&tabs=android

Content source URL

https://github.com/dotnet/docs-maui/blob/main/docs/platform-integration/communication/authentication.md

Document Version Independent Id

829bc017-4a10-6ca5-0717-e1e62f59aacc

Article author

@davidbritch

Metadata

  • ID: 829bc017-4a10-6ca5-0717-e1e62f59aacc
  • Service: dotnet-mobile
  • Sub-service: dotnet-maui
@erossini erossini changed the title Web authenticator with MAUI (.NET 8): too many redirection Web authenticator with MAUI (.NET 8): too many redirections Jan 16, 2024
@davidbritch davidbritch added the product-question Product usage related questions [org] label Jan 29, 2024
@davidbritch
Copy link
Contributor

Hi @erossini

The solution on Windows is basically to do as it says at dotnet/maui#2702 (comment)

Being honest, WebAuthenticator is really for using when you need to use web auth with a provider other than one of the main providers (e.g. Microsoft, Google, Apple, Facebook etc.). If you're using one of the main auth providers, a better approach would be to use MSAL - https://learn.microsoft.com/en-us/entra/identity-platform/msal-overview - it does fully work with .NET MAUI.

https://github.com/Azure-Samples/ms-identity-dotnetcore-maui/tree/main and https://github.com/Azure-Samples/ms-identity-docs-code-dotnet/tree/main/xplat-maui may help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants