ServiceStack - Authentication for domain and subdomains

妖精的绣舞 提交于 2019-12-02 01:08:20

问题


I want to host the ServiceStack authentication providers on the root of a domain (domain.com) and have the authentication work for the entire domain (sub1.domain.com, sub2.domain.com).

Is it possible to replace the default implementation of ICookies with my own so I can set domain in the cookies?

I am seeing that HttpResponseWrapper instantiates the default implementation so I am guessing no.

Is there another approach?


回答1:


I addressed my issue with the following pull request.

In Web.config, you can specify the domain for your cookies. ServiceStack was overwriting this value, but now ServiceStack will leave it alone if it is specified.

<configuration>
  <system.web>
    <httpCookies domain=".domain.com" />
  </system.web>
</configuration>


来源:https://stackoverflow.com/questions/13829537/servicestack-authentication-for-domain-and-subdomains

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!