[英]AADSTS65001: The user or administrator has not consented to use the application with ID <app-id>
[英]AADSTS50146: This application is required to be configured with an application-specific signing key
我正在創建一個Angular 7應用程序。 我們已使用angular-oauth2-oidc連接到Azure AD並進行身份驗證。 將Azure AD設置為OPENID進行身份驗證。 從管理Azure AD的團隊中,我們還獲得了一個安全密鑰。 由於我是新手,所以我無法弄清楚需要在哪里使用。 在線搜索也沒有得到太多幫助。
當我發布此代碼並打開應用程序時,它會被重定向,但是在micosoft網站本身登錄后,它拋出以下錯誤
AADSTS50146:此應用程序需要配置有特定於應用程序的簽名密鑰。
任何人都可以幫忙。
以下是我們在app.component.ts中使用的代碼示例
export const authConfig: AuthConfig = {
issuer: 'https://sts.windows.net/<tanend id>/',
redirectUri: window.location.origin + '/',
logoutUrl: 'https://login.microsoftonline.com/<tanend id>/oauth2/logout',
clientId: '<cliend id>',
strictDiscoveryDocumentValidation: false,
responseType: 'id_token',
scope: 'openid profile email',
waitForTokenInMsec: 2000,
oidc: true
};
private async ConfigAuth(): Promise<void> {
this.oauthService.configure(authConfig);
this.oauthService.setStorage(sessionStorage);
this.oauthService.tokenValidationHandler = new JwksValidationHandler();
this.oauthService.requireHttps = true;
}
constructor(private oauthService: OAuthService) { }
async ngOnInit(){
await this.ConfigAuth();
if (!this.oauthService.getAccessToken()) {
this.oauthService.loadDiscoveryDocument().then((doc) => {
this.oauthService.tryLogin()
.catch(err => {
console.error(err);
})
.then(() => {
// this.router.navigate(['/'])
if (!this.oauthService.hasValidAccessToken()) {
this.oauthService.initImplicitFlow()
}
});
});
}
console.log(this.oauthService.getAccessToken());
}
這是通過在廣告方面進行更改來解決的(請做單獨的團隊,沒有太多細節),還通過以下鏈接https://damienbod.com/2018/01/23/using-the-dotnet-angular-帶有天藍色的ad-oidc隱式流模板/
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.