Azure AD B2C 포털을 사용하여 토큰을 생성 중입니다. loginPopup 메서드를 사용할 때 tokenRedirect를 사용하는 동안 성공적으로 토큰을 생성 할 수 있지만 undefined
을 얻었습니다. 여기 Azure AD B2C 포털에서 loginRedirect로 액세스 토큰 생성
clientApplication = new Msal.UserAgentApplication(
this.tenantConfig.clientID, this.authority,
function (errorDesc: any, token: any, error: any, tokenType: any) {
// Called after loginRedirect or acquireTokenPopup
}
);
public login(): void {
var _this = this;
// loginRedirect loginPopup
this.clientApplication.loginPopup(this.tenantConfig.b2cScopes).then(function (idToken: any) {
_this.clientApplication.acquireTokenSilent(_this.tenantConfig.b2cScopes).then(
function (accessToken: any) {
_this.access_token = accessToken;
}, function (error: any) {
_this.clientApplication.acquireTokenPopup(_this.tenantConfig.b2cScopes).then(
function (accessToken: any) {
_this.access_token = accessToken;
}, function (error: any) {
bootbox.alert("Error acquiring the popup:\n" + error);
});
})
}, function (error: any) {
bootbox.alert("Error during login:\n" + error);
});
console.log(`access token service file ${_this.access_token}`);
}
날 내가 뭐하는 거지 실수 알려주세요? 범위 문제 또는 콜백 메소드 문제입니까?
msal.nonce.idtoken에서이 파일을 발견했습니다. –