问题
We are using the MSAL service with an Angular App we built to use our AD B2C Login and Authentication.
The problem we are running into is that the Angular App has many routes, several of them are parameterized and can have n number of possibilities.
We set up the MSAL Service in our Angular like:
B2CAccessTokenKey = 'b2c.access.token';
tenantConfig = {
tenant: 'deepdivebioportal.onmicrosoft.com',
clientID: 'xxxxxx-xxxx-xxxx-xxxx-xxxxx',
signInPolicy: 'B2C_1_signin',
signUpPolicy: 'B2C_1_signup',
redirectUri: 'https://xxx.yyyy.net',
b2cScopes: ['https://zzzzz.onmicrosoft.com/api/Hello.Read']
};
// Configure the authority for Azure AD B2C
authority = 'https://login.microsoftonline.com/tfp/' + this.tenantConfig.tenant + '/' + this.tenantConfig.signInPolicy;
/*
* B2C SignIn SignUp Policy Configuration
*/
clientApplication = new Msal.UserAgentApplication(
this.tenantConfig.clientID, this.authority,
function (errorDesc: any, token: any, error: any, tokenType: any) {
}
);
We are using Aquire Token Silently to refresh the token on refresh:
this.clientApplication.acquireTokenSilent(this.tenantConfig.b2cScopes);
We have added all our higher level routes to the App Setup Redirect URI's in Azure and if the user just happens to be on a route that is not explicitly in the list we get an error and can't refresh the token.
I have found many other questions asking similar questions and the solution seems to be to use wildcards in the redirect uri. However this no longer seems to be supported.
Is there a solution for this to handle n number of redirect routes?
The specific error I am getting:
main.b13cb77fd1caaf3b9027.js:1 ERROR Error: Uncaught (in promise): AADB2C90006: The redirect URI 'https://xxxxxx.yyyyyyy.zzz/ttttttt/show/23' provided in the request is not registered for the client id 'd86e217f-7a14-4cfc-b6ae-4f46a2eff943'.
来源:https://stackoverflow.com/questions/56195622/active-directory-b2c-redirect-uri-with-angular-app