CommunityToolkit / CommunityToolkit/Graph-Controls

MsalProvider uses unknown redirect URI, authentication fails

Abierto
#188 6 comentarios 0 reacciones 0 asignados Ver en GitHub
Area: Providers documentation :page_with_curl: question :grey_question:
Lenguaje dominante
C#
Estrellas
156
Forks
38
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

## Describe the bug
When using the MsalProvider as documented and as in the sample, auth fails with AADSTS50011.

```
Request Id: 5e464c00-92a4-4a14-a5e6-f6c807527900
Correlation Id: 70fa290d-da9e-4a48-ac59-98da60a73410
Timestamp: 2022-04-29T14:51:55Z
Message: AADSTS50011: The redirect URI 'ms-appx-web://Microsoft.AAD.BrokerPlugin/S-1-15-2-3827128064-569582487-4294593430-3382639814-4294318972-3676523608-2734131615' specified in the request does not match the redirect URIs configured for the application '3892d014-2554-4df7-a10b-9f1e5c0742e7'. Make sure the redirect URI sent in the request matches one added to your application in the Azure portal. Navigate to https://aka.ms/redirectUriMismatchError to learn more about how to fix this.
```

- [ ] Is this bug a regression in the toolkit? If so, what toolkit version did you last see it work:

## Steps to Reproduce
Steps to reproduce the behavior:
1. Register an app in Azure AD using the redirect URI `https://login.microsoftonline.com/common/oauth2/nativeclient`.
2. Configure your provider.

```csharp
string[] scopes = new string[] { "User.Read" };
ProviderManager.Instance.GlobalProvider =
new MsalProvider("CLIENT_ID", scopes);
```
3. Try to login with the `LoginButton`.

## Expected behavior
Should login

## Environment

```
NuGet Package(s):
CommunityToolkit.Authentication.Msal 7.1.1
CommunityToolkit.Graph.Uwp 7.1.1

Windows 11 Build Number: (10.0; Build 22000)

App min and target version: Windows 10, version 2104 (10.0; Build 20348), Target Windows 11 (10.0; Build 22000)

Device form factor:
- [x] Desktop
- [ ] Xbox
- [ ] Surface Hub
- [ ] IoT

Visual Studio
- [ ] 2017 (version: )
- [ ] 2019 (version: )
- [ ] 2019 Preview (version: )
- [x] 2022 (version: 17.1.6)

```

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.