【发布时间】:2021-07-13 09:14:23
【问题描述】:
我正在开发一个需要使用 AD FS 进行身份验证的 Angular SPA。我使用 Spring Boot 作为后端。
this.oauthService.configure({
redirectUri: window.location.origin + '/app/search',
requireHttps: true,
scope: 'openid profile email',
responseType: 'id_token token',
oidc: true,
clientId: environment.adfsClientId,
loginUrl: environment.adfsUrl + '/oauth2/authorize',
issuer: environment.adfsUrl,
logoutUrl:
environment.adfsUrl +
'/ls/?wa=wsignoutcleanup1.0&wreply=' +
location.protocol +
'//' +
location.hostname +
(location.port ? ':' + location.port : ''),
postLogoutRedirectUri:
location.protocol +
'//' +
location.hostname +
(location.port ? ':' + location.port : ''),
});
上面给出的是配置。我正在关注this 作为参考。
但我收到以下错误。
加载发现文档时出错 O {headers: h, status: 0, statusText: "Unknown Error", url: "https://adfs_domain/adfs/.well-known/openid-configuration", ok: false, …} 错误:ProgressEvent {isTrusted:true,lengthComputable:false,加载:0,总数:0,类型:“错误”,...} 标头:h {normalizedNames:地图(0),lazyUpdate:空,标头:地图(0)} 消息:“https://adfs_domain/adfs/.well-known/openid-configuration 的 Http 失败响应:0 未知错误” 名称:“HttpErrorResponse” 好的:假的 状态:0 statusText:“未知错误” 网址:“https://adfs_domain/adfs/.well-known/openid-configuration”
注意:我可以从我的浏览器访问相同的 URL,https://adfs_domain/adfs/.well-known/openid-configuration。配置中的 issuer URL 和浏览器中的响应也是一样的。
谁能帮忙?
【问题讨论】:
-
您的应用程序是否使用有效证书在 https 上运行?可能是您的 ADFS 拒绝来自不安全的引用者的连接。
-
应用在 HTTPS 上运行。但我不确定证书。如何检查,在哪里可以配置?
-
我联系了服务器管理员,他说在测试和预生产环境中使用自签名 SSL 证书。
标签: angular oauth-2.0 adfs angular-oauth2-oidc