CommunityToolkit / CommunityToolkit/Graph-Controls

MsalProvider uses unknown redirect URI, authentication fails

未关闭
#188 6 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
Area: Providers documentation :page_with_curl: question :grey_question:
主要语言
C#
星标
156
派生
38
PR 合并指标
30 天内没有已合并 PR

描述

## 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)

```

贡献指南

这个仓库没有索引到贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。