Hello,
I am trying to get JWTToken authentication to work for services accesible through different subdomains. I’d like the Servicestack login API to return the ss-tok, ss-sid cookies set to domain “.mywebsite.dev” for which I’ve added subdomains to my hosts file. I am using login.mywebsite.dev to host the JWTAuthToken signing service for example.
I have tried using the both the web config approach as outlined here:
<system.webServer>
<httpCookies domain=".mywebsite.dev" />
and the RestrictAllCookiesToDomain approach outlined here:
SetConfig(new HostConfig
{
DebugMode = AppSettings.Get("DebugMode", false),
AddRedirectParamsToQueryString = true,
RestrictAllCookiesToDomain = ".mywebsite.dev"
});
However both approaches do not seem to set a domain in the cookie headers received in the response:
Connection:keep-alive
Content-Type:application/json; charset=utf-8
Date:Wed, 14 Dec 2016 14:17:06 GMT
Server:nginx/1.4.6 (Ubuntu)
Set-Cookie:ss-id=GODjtqGB5UEwrD5QEn4g; path=/
Set-Cookie:ss-pid=8jzMkf8zHO5ht2RjlA9e; expires=Sun, 14 Dec 2036 14:17:05 GMT; path=/
Set-Cookie:ss-opt=temp; expires=Sun, 14 Dec 2036 14:17:05 GMT; path=/
Set-Cookie:X-UAId=18; expires=Sun, 14 Dec 2036 14:17:06 GMT; path=/
Set-Cookie:ss-tok=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiIsImtpZCI6IlE5dSJ9.eyJzdWIiOjE4LCJpYXQiOjE0ODE3MjUwMjYsImV4cCI6MTQ4MjkzNDYyNiwiZW1haWwiOiJhZG1pbkBvcmRlcmJhc2UubmwiLCJnaXZlbl9uYW1lIjoiU3VwZXIiLCJmYW1pbHlfbmFtZSI6IkFkbWluIiwibmFtZSI6IlN1cGVyIEFkbWluIiwicHJlZmVycmVkX3VzZXJuYW1lIjoic3VwZXIifQ.FPwi78nUVHxDg7Rfn5OZ4HMF4Zl5cG_2MPaZ9pWCOF8; expires=Wed, 28 Dec 2016 14:17:06 GMT; path=/; httponly
Transfer-Encoding:chunked
Vary:Accept
X-Powered-By:ServiceStack/1.030 NETStandard/.NET
Am I doing something wrong? Have I run into a .NET Core/Kestrel thing? Any insight would be much appreciated.
I am currently using the following packages in my project.json file.
{
"dependencies": {
"Microsoft.NETCore.App": {
"version": "1.0.1",
"type": "platform"
},
"ServiceStack.Core": "1.0.*",
"ServiceStack.Redis.Core": "1.0.*",
"ServiceStack.Common.Core": "1.0.*",
"ServiceStack.Client.Core": "1.0.*",
"ServiceStack.Interfaces.Core": "1.0.*",
"ServiceStack.Text.Core": "1.0.*",
"Microsoft.AspNetCore.Diagnostics": "1.0.0",
"Microsoft.AspNetCore.Server.IISIntegration": "1.0.0",
"Microsoft.AspNetCore.Server.Kestrel": "1.0.1",
"Microsoft.Extensions.Logging.Console": "1.0.0",
"Microsoft.Extensions.Configuration": "1.0.0",
"Microsoft.Extensions.Configuration.Json": "1.0.0"
},
"tools": {
"Microsoft.AspNetCore.Server.IISIntegration.Tools": "1.0.0-preview2-final",
"Microsoft.DotNet.Watcher.Tools": "1.0.0-preview2-final"
},
"frameworks": {
"netcoreapp1.0": {
"imports": [
"dotnet5.6",
"portable-net45+win8"
]
}
},
}