Tôi đang cố gắng triển khai Azure Active Directory B2C trong một trang mới mà tôi đang phát triển, nhưng tôi nhận được lỗi này 404 - File or directory not found
khi cố gắng đăng nhập từ trang của tôi.Cố gắng triển khai Azure Active Directory B2C cho tôi lỗi 404
Tôi đã đặt người thuê nhà, đăng ký ứng dụng của mình, tạo chính sách của tôi, toàn bộ thỏa thuận. Tôi có thể kiểm tra chúng từ cổng Azure mà không có nhiều vấn đề. Tuy nhiên, tôi đã làm theo các hướng dẫn trên official tutorial để triển khai các chính sách trong trang của tôi không có lịch phát sóng, tôi nhận được lỗi 404 được đề cập như thể thiếu một số thứ.
Tôi thậm chí đã tải xuống mã được đăng ở đó và nó hoạt động!
Tôi đã thử so sánh cả hai mã nhưng thực sự không thể thấy sự khác biệt. Tuy nhiên, tôi đang dán mã của tôi ở đây hy vọng bạn có thể giúp tôi với điều này.
web.config
<add key="ida:Tenant" value="PlataformaXXX.onmicrosoft.com" />
<add key="ida:ClientId" value="84d2a6e6-4cac-4c53-a5ff-XXXXXXXXXXXX" />
<add key="ida:AadInstance" value="https://login.microsoftonline.com/{0}/v2.0/.well-known/openid-configuration?p={1}" />
<add key="ida:RedirectUri" value="https://localhost:59744/" />
<add key="ida:SignUpPolicyId" value="B2C_1_Sign_Up" />
<add key="ida:SignInPolicyId" value="B2C_1_Sign_In" />
<add key="ida:UserProfilePolicyId" value="B2C_1_Edit" />
STARTUP.AUTH.CS
public partial class Startup
{
// App config settings
private static string clientId = ConfigurationManager.AppSettings["ida:ClientId"];
private static string aadInstance = ConfigurationManager.AppSettings["ida:AadInstance"];
private static string tenant = ConfigurationManager.AppSettings["ida:Tenant"];
private static string redirectUri = ConfigurationManager.AppSettings["ida:RedirectUri"];
// B2C policy identifiers
public static string SignUpPolicyId = ConfigurationManager.AppSettings["ida:SignUpPolicyId"];
public static string SignInPolicyId = ConfigurationManager.AppSettings["ida:SignInPolicyId"];
public static string ProfilePolicyId = ConfigurationManager.AppSettings["ida:UserProfilePolicyId"];
public void ConfigureAuth(IAppBuilder app)
{
app.SetDefaultSignInAsAuthenticationType(CookieAuthenticationDefaults.AuthenticationType);
app.UseCookieAuthentication(new CookieAuthenticationOptions());
// Configure OpenID Connect middleware for each policy
app.UseOpenIdConnectAuthentication(CreateOptionsFromPolicy(SignUpPolicyId));
app.UseOpenIdConnectAuthentication(CreateOptionsFromPolicy(ProfilePolicyId));
app.UseOpenIdConnectAuthentication(CreateOptionsFromPolicy(SignInPolicyId));
} ...
Nếu bất kỳ đoạn khác của mã là cần thiết, xin vui lòng cho tôi biết.
Các bạn thực sự, mọi trợ giúp sẽ được đánh giá rất nhiều.
Trân trọng, Toño.
Những gì^ông nói :) – dstrockis
Xin lỗi để trả lời muộn này. Các gói phần mở rộng đã mất tích và sau khi tôi cài đặt nó và cập nhật các gói WebGrease và Antlr mọi thứ diễn ra suôn sẻ. Cảm ơn! –
tôi đã phải cập nhật microsoft.identitymodel.protocol.extensions và nó đã sửa lỗi của tôi. cảm ơn! – Bryan