![](/img/trans.png)
[英]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.