MSAL的MSAL身份验证B2C显示黑屏
I am working with the .NET MAUI starter project (calling it AuthTest) and adding the changes from
该代码可以在AcquireTokenInteractive调用中正常工作,然后使用黑屏幕坐着(大概等待B2C进程完成)...没有错误消息或任何所需的指示。
停止的代码是:
public async Task<AuthenticationResult> LoginAsync(CancellationToken cancellationToken) {
AuthenticationResult result;
try {
result = await _authClient
.AcquireTokenInteractive(_constants.Scopes)
.WithPrompt(Prompt.ForceLogin)
#if ANDROID
.WithParentActivityOrWindow(Platform.CurrentActivity)
#endif
.ExecuteAsync(cancellationToken);
return result;
}
catch(MsalClientException) { return null; }
}
它永远不会达到返回结果;
有人看到了这一点并有一些建议可以尝试吗?
I am working with the .NET MAUI starter project (calling it AuthTest) and adding the changes from this article, but when the android emulator tries to start the B2C process all I get back is black screen that just sits until the system gives me the 'AuthTest isn't responding' message. HAs anyone seen this and know what causes it?
The code works fine up to the AcquireTokenInteractive call and then just sits (presumably waiting for the B2C process to complete) with a black screen...no error message or any indication what it is looking for.
The code that stops at is:
public async Task<AuthenticationResult> LoginAsync(CancellationToken cancellationToken) {
AuthenticationResult result;
try {
result = await _authClient
.AcquireTokenInteractive(_constants.Scopes)
.WithPrompt(Prompt.ForceLogin)
#if ANDROID
.WithParentActivityOrWindow(Platform.CurrentActivity)
#endif
.ExecuteAsync(cancellationToken);
return result;
}
catch(MsalClientException) { return null; }
}
It just never reaches the return result;
Has anyone seen this and have some suggestions to try?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
对于任何尝试与上面相同的事情的人,我发现本文有效。我尚未将其与上面的一个进行比较以找到差异,但是链接的文章中的示例代码(在此答案中)允许MAUI应用程序登录AAD B2C租户。
For anyone trying the same thing as above, I have found that this article works. I have not yet compared this to the one above to find the differences, but the sample code from the linked article (in this answer) allows a MAUI application to login against AAD B2C tenant.