简体   繁体   English

使用 Angular SPA MSAL 库在 Azure B2C 上执行用户流程

[英]Execute user flow on Azure B2C with Angular SPA MSAL library

I have setup a Azure B2C for experimenting, and have created a signupandsign as a user flow.我已经设置了一个 Azure B2C 进行实验,并创建了一个注册和签名作为用户流程。

I've followed the github samples on how to use the MSAL library from Angular 2+ and have as a result got this format:我遵循了 github 示例,了解如何使用 Angular 2+ 中的 MSAL 库,结果得到了这种格式:

export const protectedResourceMap: [string, string[]][] = [
  ['https://graph.microsoft.com/v1.0/me', ['user.read']],
];

function MSALConfigFactory(): Configuration {
  return {
    auth: {
      clientId: environment.clientId,
      authority: environment.authority,
      validateAuthority: true,
      redirectUri: environment.redirectUrl,
      postLogoutRedirectUri: environment.redirectUrl,
      navigateToLoginRequestUrl: true,
    },
    cache: {
      storeAuthStateInCookie: false, // set to true for IE 11
    },
  };
}

function MSALAngularConfigFactory(): MsalAngularConfiguration {
  return {
    popUp: false,
    protectedResourceMap
  };
}

export const environment = {
  production: false,
  clientId: '22ccxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',
  authority: 'https://login.microsoftonline.com/bc5xxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/',
  redirectUrl: 'http://localhost:4200'
};

But all it does it take to sign in page, doesn't give me any options for sign up.但是登录页面所需的一切,并没有给我任何注册选项。 How do i trigger the signupandsign user flow from my Angular SPA?如何从我的 Angular SPA 触发 signupandsign 用户流程?

The sample which you are referring helps you to Sign in users and call the Microsoft Graph API from an Angular single-page application.您所指的示例可帮助您登录用户并从 Angular 单页应用程序调用 Microsoft Graph API。

In the document you can see below note which points you to the tutorial在文档中,您可以看到下面的注释,它指向教程

Note: A more detailed tutorial covering this sample can be found here. 

Please refer the Sample for B2C Angular SPA.请参阅 B2C Angular SPA 的示例

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 使用Azure AD B2C时向Angular SPA和MSAL添加角色 - Adding roles to Angular SPA and MSAL when using using Azure AD B2C 使用 Azure AD B2C 从 Angular 应用程序和 msal.js 登录重定向用户 - Login redirect a user with Azure AD B2C from an Angular application and msal.js 在Angular 4.5 Service中未定义的Msal用于Azure B2C身份验证 - Msal undefined in Angular 4.5 Service for Azure B2C authentication Angular 8 与 Azure B2C 身份验证(使用 MSAL.js) - Angular 8 with Azure B2C Authentication (using MSAL.js) 使用B2C在Javascript / Angular 6 SPA应用程序中通过MSAL.JS注销的错误 - Error in Logout through MSAL.JS in Javascript / Angular 6 SPA application using B2C 使用 MSAL 库对 azure b2c 和未受保护资源中的用户进行身份验证时出错 - Error in using MSAL library to authenticate users in azure b2c and unprotected resources 来自 Angular 应用程序和 msal 的 Azure AD B2C:加载自定义 UI Html - Azure AD B2C from an Angular application and msal: Loading customized UI Html 登录到应用程序后,带有MSAL和Angular的Azure AD B2C会立即重定向到登录页面 - Azure AD B2C with MSAL and Angular redirects to login page immediately after logging into the app redirect_uri_mismatch Azure AD B2C,角度使用MSAL - redirect_uri_mismatch Azure AD B2C with angular using MSAL Angular 4 / Angular 2针对Azure B2C Active Directory验证SPA - Angular 4/Angular 2 validate SPA against Azure B2C Active Directory
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM