Identity Server 4 学习(十)Identity
2021-11-16 本文已影响0人
寻找无名的特质
我们希望Identity Server 4 和 Identity Server Admin 能够支持http,并且可以部署在IIS上,在很多企业内部,不需要使用SSL。我们需要解决SameSite Policy问题。为了实现这个目的,需要在Identity Server 4 STS和Identity Server Admin项目中安装包ZL.SameSiteCookieSupport,并且修改代码,在Startup的ConfigureServices中增加代码如下:
services.AddSameSiteSupport();
在Configure中增加代码如下:
app.UseCookiePolicy();
还需要安装ZL.ServerUrlsExt,可以在配置文件或者命令行中定义端口(如果在IIS部署,不需要这一步)。这样Identity Server STS和Identity Server Admin 就都支持http协议下工作了。