ADFS + IdentityServer4 + MSIS9642 无法构造 id 令牌
ADFS + IdentityServer4 + MSIS9642 unable to construct an id token
我们的需求是通过ADFS设置auth。
IdentityServer 用于登录。
我们需要 ADFS,因为我们有一个 SharePoint 并且我们有多个声明提供者。
我们尝试做的事情:
SPA <--> ADFS <--> IdentityServer
URLS
SPA: https://example.com/app
ADFS: http://fedsrv.example.com/adfs
ID: https://idp.example.com/spa
ADFS
在 ADFS 中,我们设置了一个应用程序组:OIDC_SPA
和一个本机应用程序 Portal
和一个 Web API Portal
.
本机应用确实有一个客户端 ID:example
和一个重定向 URI:
https://example.com/app
Web API 确实有依赖方标识符:example
、
有 Permit everyone
政策
和转换规则 PT all
: x:[] => issue(claim = x);
和客户许可 allatclaims, opened and profile
声明提供者信任配置如下:
CP 联邦元数据 URL:https://idp.example.com/spa/wsfed/FederationMetadata/2007-06/FederationMetadata.xml
CP标识符为https://idp.example.com/spa
WS-Fed 被动端点是:https://idp.example.com/spa/wsfed
我们还设置了 AnchorClaimType:
set-adfsclaimsprovidertrust -targetidentifier https://idp.example.com/spa -AnchorClaimType http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name
以及家庭领域映射:
Set-AdfsWebApiApplication -TargetName OIDC_SPA -ClaimsProviderName "<CP name>"
IdentityServer
我们添加了一个 ClientID 为 http://fedsrv.example.com/adfs/services/trust
的客户端
协议类型:wsfed
依赖方:
| Field | Value |
|--------------------------|--------|
| Realm | http://fedsrv.example.com/adfs/services/trust |
| TokenType | urn:oasis:names:tc:SAML:2.0:assertion |
| SignatureAlgorithm | http://www.w3.org/2001/04/xmldsig-more#rsa-sha256 |
| DigestAlgorithm | http://www.w3.org/2001/04/xmlenc#sha256 |
| SamlNameIdentifierFormat | urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified |
IdentityResources
配置了 opened
和 profile
。
我们是忘记了什么还是配置有误?
问题是,声明未正确映射到 Application Group
和 Claims Provider trust
。
我们的需求是通过ADFS设置auth。
IdentityServer 用于登录。
我们需要 ADFS,因为我们有一个 SharePoint 并且我们有多个声明提供者。
我们尝试做的事情:
SPA <--> ADFS <--> IdentityServer
URLS
SPA: https://example.com/app
ADFS: http://fedsrv.example.com/adfs
ID: https://idp.example.com/spa
ADFS
在 ADFS 中,我们设置了一个应用程序组:OIDC_SPA
和一个本机应用程序 Portal
和一个 Web API Portal
.
本机应用确实有一个客户端 ID:example
和一个重定向 URI:
https://example.com/app
Web API 确实有依赖方标识符:example
、
有 Permit everyone
政策
和转换规则 PT all
: x:[] => issue(claim = x);
和客户许可 allatclaims, opened and profile
声明提供者信任配置如下:
CP 联邦元数据 URL:https://idp.example.com/spa/wsfed/FederationMetadata/2007-06/FederationMetadata.xml
CP标识符为https://idp.example.com/spa
WS-Fed 被动端点是:https://idp.example.com/spa/wsfed
我们还设置了 AnchorClaimType:
set-adfsclaimsprovidertrust -targetidentifier https://idp.example.com/spa -AnchorClaimType http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name
以及家庭领域映射:
Set-AdfsWebApiApplication -TargetName OIDC_SPA -ClaimsProviderName "<CP name>"
IdentityServer
我们添加了一个 ClientID 为 http://fedsrv.example.com/adfs/services/trust
的客户端
协议类型:wsfed
依赖方:
| Field | Value |
|--------------------------|--------|
| Realm | http://fedsrv.example.com/adfs/services/trust |
| TokenType | urn:oasis:names:tc:SAML:2.0:assertion |
| SignatureAlgorithm | http://www.w3.org/2001/04/xmldsig-more#rsa-sha256 |
| DigestAlgorithm | http://www.w3.org/2001/04/xmlenc#sha256 |
| SamlNameIdentifierFormat | urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified |
IdentityResources
配置了 opened
和 profile
。
我们是忘记了什么还是配置有误?
问题是,声明未正确映射到 Application Group
和 Claims Provider trust
。