【发布时间】:2019-07-25 03:55:02
【问题描述】:
我正在关注https://docs.microsoft.com/en-us/windows-server/identity/ad-fs/development/single-page-application-with-ad-fs,我正在从 github 克隆代码,并按照所有步骤在 ADFS 中创建应用程序组并修改代码中的更改。它工作正常,单击登录或尝试访问待办事项列表页面将我带到 ADFS 登录页面,然后将我重定向回应用程序页面,但是当我尝试“待办事项列表”页面时,它给了我{"Message":"Authorization has been denied for this request."}。
检查了 chrome 开发人员工具(以及 Fiddler)中的网络流量,并且对 TodoList 的请求(请求 URL:https://localhost:44326/api/TodoList)具有授权标头:
授权:承载 eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsIng1dCI6Inp4anhjL
查看所有其他流量,其他一切都很好。
https://pdc.mkdomain.com:44326/#/UserData 显示以下结果:
Id_token content
mohsen@mkdomain.com
aud:https://pdc.mkdomain.com:44326/
iss:https://PDC.mkdomain.com/adfs
iat:1551610099
nbf:
exp:1551613699
ver:
tid:
amr:
oid:
upn:mohsen@mkdomain.com
unique_name:Mohsen@mkdomain.com
sub:JIg5DslCMEyKf8AnKpvNg3XQf+KN58tgOzYEjlZ+WZA=
family_name:
given_name:
pwd_exp:
pwd_url:
在中继方信任方面我有:
c:[Type == "http://schemas.microsoft.com/ws/2008/06/identity/claims/windowsaccountname", Issuer == "AD AUTHORITY"]
=> issue(store = "Active Directory",
types = ("http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name",
"http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress",
"http://schemas.xmlsoap.org/ws/2005/05/identity/claims/givenname",
"family_name"),
query = ";displayName,mail,givenName,sn;{0}", param = c.Value);
在 Insuance 转换规则中我有:
c:[Type == "http://schemas.microsoft.com/ws/2008/06/identity/claims/windowsaccountname",
Issuer == "AD AUTHORITY"]
=> issue(store = "Active Directory",
types = ("http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress",
"http://schemas.xmlsoap.org/ws/2005/05/identity/claims/givenname",
"http://schemas.xmlsoap.org/ws/2005/05/identity/claims/surname",
"http://schemas.xmlsoap.org/claims/Group",
"http://schemas.microsoft.com/ws/2008/06/identity/claims/windowsaccountname"),
query = ";mail,givenName,sn,tokenGroups(SID),sAMAccountName;{0}",
param = c.Value);
【问题讨论】: