Open steve-cardenas opened 1 year ago
Hi @steve-cardenas , could you help provide a minimal project for that error? And how do you get the token from client's credentials and Angular app which makes the iss different, could you provide more information thanks.
I am using the code of the following application for the front-end in Angular.
The parameters for the front-end are similar to these:
import { LogLevel, Configuration, BrowserCacheLocation } from '@azure/msal-browser';
const isIE = window.navigator.userAgent.indexOf("MSIE ") > -1 || window.navigator.userAgent.indexOf("Trident/") > -1;
export const b2cPolicies = {
names: {
signUpSignIn: 'B2C_1_sigin-signup',
resetPassword: 'B2C_1_reset',
editProfile: 'B2C_1_edit_profile',
},
authorities: {
signUpSignIn: {
authority: 'https://nametenant.b2clogin.com/nametenant.onmicrosoft.com/B2C_1_sigin-signup',
},
resetPassword: {
authority: 'https://nametenant.b2clogin.com/nametenant.onmicrosoft.com/B2C_1_reset',
},
editProfile: {
authority: 'https://nametenant.b2clogin.com/nametenant.onmicrosoft.com/b2c_1_edit_profile',
},
},
authorityDomain: 'nametenant.b2clogin.com',
};
export const msalConfig: Configuration = {
auth: {
clientId: '41e57c38-009d-4254-aa6d-b1d6d63f0e63', // This is the ONLY mandatory field that you need to supply.
authority: b2cPolicies.authorities.signUpSignIn.authority, // Defaults to "https://login.microsoftonline.com/common"
knownAuthorities: [b2cPolicies.authorityDomain], // Mark your B2C tenant's domain as trusted.
//validate prod
redirectUri: '/auth', // Points to window.location.origin by default. You must register this URI on Azure portal/App Registration.
postLogoutRedirectUri: '/', // Points to window.location.origin by default.
},
cache: {
cacheLocation: BrowserCacheLocation.LocalStorage, // Configures cache location. "sessionStorage" is more secure, but "localStorage" gives you SSO between tabs.
storeAuthStateInCookie: isIE, // Set this to "true" if you are having issues on IE11 or Edge. Remove this line to use Angular Universal
},
system: {
/**
* Below you can configure MSAL.js logs. For more information, visit:
* https://docs.microsoft.com/azure/active-directory/develop/msal-logging-js
*/
loggerOptions: {
loggerCallback(logLevel: LogLevel, message: string) {
console.log(message);
},
logLevel: LogLevel.Verbose,
piiLoggingEnabled: false
}
}
}
I am using the code of the following application for the Back-end in Java:
The parameters for the back-end are similar to these:
spring:
cloud:
azure:
active-directory:
b2c:
enabled: true
base-uri: https://NameTenant.b2clogin.com/NameTenant.onmicrosoft.com # Such as: https://xxxxb2c.b2clogin.com
profile:
tenant-id: e761f276-37f8-499d-aaec-47801cdea4d1
app-id-uri: https://NameTenant.onmicrosoft.com/Java-webapi # If you are using v1.0 token, please configure app-id-uri for `aud` verification
credential:
client-id: 756fbf55-2f45-4c9a-a9c6-599a8008c4dd # If you are using v2.0 token, please configure client-id for `aud` verification
user-flows:
sign-up-or-sign-in: B2C_1_sigin-signup
@Netyyyy are there any updates on this?
I'm running into the same issue. I tried different versions of the maven spring-cloud-azure-starter-active-directory-b2c package compatible with Spring Boot 2.7.x and 3.x but without success. It keeps giving the "is not registered in trusted issuer repository, so cannot create JWSKeySelector." error.
I think what OP means is that when a microsoftonline url is configured as issuer in the Java app it is automatically translated to a b2clogin url (at least that's what I think).
Hi @Daantie , thanks for asking. This issue is in our backlog. Please vote for this feature so we could prioritize it.
/vote
While working on an Angular App connected to Azure B2C, I received the next exception while calling the Java API.
I was reviewing the issuer generation process and noticed a difference.
When I used the client's credentials, the "iss" value was set to "https://login.microsoftonline.com/e761f276-37f8-499d-aaec-47801cdea4d1/v2.0". However, when I used my Angular app, the "iss" value changed to "https://abc.b2clogin.com/e761f276-37f8-499d-aaec-47801cdea4d1/v2.0/".
application.yml