准备:
adfs安装配置
https://www.cnblogs.com/luoyedemeng/articles/9837685.html
添加一个providers
private void configureidentityproviders(iappbuilder app, string signinastype) { var wsfederation = new wsfederationauthenticationoptions { wtrealm = "urn:identityserver", metadataaddress = "https://xxx.xxx.com/federationmetadata/2007-06/federationmetadata.xml",//这是你的ad地址 authenticationtype = "adfs", caption = "adfs", signinasauthenticationtype = signinastype, backchannelcertificatevalidator = null, wreply = "https://localhost:12345/oauth/callback", }; app.usewsfederationauthentication(wsfederation); }
配置adfs
设置你的identityserver地址
设置你的urn 我的是:urn:identityserver
接下来一路下一步就行了
注意:
最后设置一下claim
到这一步基本上完成配置
访问:https://xxx.xxx.com/federationmetadata/2007-06/federationmetadata.xml
在地址栏中键入联合身份验证服务名称,然后,在该名称的后面附加 federationmetadata/2007-06/federationmetadata.xml,以浏览到联合身份验证服务元数据终结点
注意:不能通过ip访问此地址,如果必须要访问,需要修改hots 如下:
这样就可以通过访问 huzswf07.xxxx.com访问到了 注意依旧不是ip
访问你的identityserver地址
点击此处会跳转到你的ad登录页面
ad登录之后会进入你的identityserver方法,这个方法是外部验证方法,可以在里面结合数据库账号关联或者其他操作
注意:identityserver地址必须是https的 http不行
结束
谢谢支持!!!
参考:
https://www.scottbrady91.com/identity-server/identity-server-3-using-ws-federation
黄山市民网:https://www.huangshanshimin.com/