admin管理员组文章数量:1123778
I'm using Microsoft.Identity.Web
in a .NET 9.0 Blazor server app to support Azure B2C sign up and sign in. I've got it working using a combined Sign up and sign in user flow. This doesn't seem like a great approach if somebody knows they need to sign up and I provide then with a sign up link (I'm afraid that new users might get confused or miss the fact that the sign in page is also where you sign up).
I setup a separate Sign Up user flow. I'm pretty sure Microsoft.Identity.Web
doesn't support this out of the box, so I tried to mimic the SignIn
action in Microsoft's Account controller, with the only difference being that I pass my SignUp
policy name:
[HttpGet("MicrosoftIdentity/Account/SignUp")]
public IActionResult SignUp()
{
var scheme = OpenIdConnectDefaults.AuthenticationScheme;
var redirectUrl = Url.Content("~/");
var properties = new AuthenticationProperties { RedirectUri = redirectUrl };
properties.Items[Constants.Policy] = "B2C_1_SignUp";
return Challenge(properties, scheme);
}
When I hit the signup route, I ultimately get redirected to MicrosoftIdentity/Account/Error
, and get back a 404. I also find this in my Output window:
Microsoft.AspNetCore.Authentication.OpenIdConnect.OpenIdConnectHandler: Error: Message contains error: 'unauthorized_client', error_description: 'AADB2C90057: The provided application is not configured to allow the 'OAuth' Implicit flow.
I've confirmed that my policy name is correct. If I change the policy to my Sign up and sign in policy name, it works.
Is what I'm trying to do possible? What am I missing?
本文标签: cSignup User Flow with Azure B2C and MicrosoftIdentityWebStack Overflow
版权声明:本文标题:c# - Sign-up User Flow with Azure B2C and Microsoft.Identity.Web - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736596989a1945163.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论