I’ve got it to a repeatable behavior (removed basic auth and just using credential auth). The first time I authenticate it does not return me data in the Meta dictionary - the values that I set in my custom session object (in the OnAuthenticated method) are not there when the control returns back to Authenticated method in the overridden CredentialsAuthProvider class. If I login again without logging out everything works as expected and I get data in the Meta dict. If I logout, it does the same thing described above, i.e., nothing returned in meta.
1st trip request:
POST http://localhost:56241/auth HTTP/1.1
Host: localhost:56241
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:47.0) Gecko/20100101 Firefox/47.0
Accept: application/json
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Content-Type: application/x-www-form-urlencoded
Referer: http://localhost:56241/swagger-ui/
Content-Length: 34
Cookie: ss-opt=temp
Connection: keep-alive
UserName=rucheeg&Password=password
1st trip response
HTTP/1.1 200 OK
Cache-Control: private
Content-Type: application/json; charset=utf-8
Vary: Accept
Server: Microsoft-IIS/10.0
X-Powered-By: ServiceStack/4.512 NET45 Win32NT/.NET
X-AspNet-Version: 4.0.30319
Set-Cookie: ss-id=WQr4mvP1L8NcWJAinQcm; path=/; HttpOnly
Set-Cookie: ss-pid=2yEU4l0Dt2dYwknKIRRY; expires=Wed, 15-Jul-2037 03:50:41 GMT; path=/; HttpOnly
Set-Cookie: ss-opt=temp; expires=Wed, 15-Jul-2037 03:50:41 GMT; path=/; HttpOnly
Set-Cookie: X-UAId=1004; expires=Wed, 15-Jul-2037 03:50:44 GMT; path=/; HttpOnly
X-SourceFiles: =?UTF-8?B?QzpcVXNlcnNccmd1cHRhXFNvdXJjZVxSZXBvc1xtYXN0ZXJfaW52ZW50b3J5XHNyY1xBTVMgU2VydmljZXNcRGV2aWNlU2VydmljZVxEZXZpY2UuQVBJLkhvc3RcYXV0aA==?=
X-Powered-By: ASP.NET
Date: Sat, 15 Jul 2017 03:50:48 GMT
Content-Length: 274
{“UserId”:“1004”,“SessionId”:“WQr4mvP1L8NcWJAinQcm”,“UserName”:“rucheeg”,“DisplayName”:“rucheeg”,“ReferrerUrl”:null,“BearerToken”:null,“RefreshToken”:null,“ResponseStatus”:{“ErrorCode”:null,“Message”:null,“StackTrace”:null,“Errors”:null,“Meta”:null},“Meta”:{“ClientId”:“0”}}
2nd trip request:
POST http://localhost:56241/auth HTTP/1.1
Host: localhost:56241
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:47.0) Gecko/20100101 Firefox/47.0
Accept: application/json
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Content-Type: application/x-www-form-urlencoded
Referer: http://localhost:56241/swagger-ui/
Content-Length: 34
Cookie: ss-opt=temp; ss-id=WQr4mvP1L8NcWJAinQcm; ss-pid=2yEU4l0Dt2dYwknKIRRY; X-UAId=1004
Connection: keep-alive
UserName=rucheeg&Password=password
2nd trip response:
HTTP/1.1 200 OK
Cache-Control: private
Content-Type: application/json; charset=utf-8
Vary: Accept
Server: Microsoft-IIS/10.0
X-Powered-By: ServiceStack/4.512 NET45 Win32NT/.NET
X-AspNet-Version: 4.0.30319
Set-Cookie: ss-id=utKiPdHtdzjIdnoqNbt0; path=/; HttpOnly
Set-Cookie: ss-pid=5EEBzrq4dAuaggjxVwBb; expires=Wed, 15-Jul-2037 03:53:07 GMT; path=/; HttpOnly
Set-Cookie: ss-opt=temp; expires=Wed, 15-Jul-2037 03:53:07 GMT; path=/; HttpOnly
Set-Cookie: X-UAId=1004; expires=Wed, 15-Jul-2037 03:53:12 GMT; path=/; HttpOnly
X-SourceFiles: =?UTF-8?B?QzpcVXNlcnNccmd1cHRhXFNvdXJjZVxSZXBvc1xtYXN0ZXJfaW52ZW50b3J5XHNyY1xBTVMgU2VydmljZXNcRGV2aWNlU2VydmljZVxEZXZpY2UuQVBJLkhvc3RcYXV0aA==?=
X-Powered-By: ASP.NET
Date: Sat, 15 Jul 2017 03:53:17 GMT
Content-Length: 287
{“UserId”:“1004”,“SessionId”:“utKiPdHtdzjIdnoqNbt0”,“UserName”:“rucheeg”,“DisplayName”:“rucheeg”,“ReferrerUrl”:null,“BearerToken”:null,“RefreshToken”:null,“ResponseStatus”:{“ErrorCode”:null,“Message”:null,“StackTrace”:null,“Errors”:null,“Meta”:null},“Meta”:{“ClientId”:“1”,“Roles”:"[]"}}