IdentityServer / IdentityServer3

OpenID Connect Provider and OAuth 2.0 Authorization Server Framework for ASP.NET 4.x/Katana
https://identityserver.github.io/Documentation/
Apache License 2.0
2.01k stars 764 forks source link

Serialization of RefreshTokens #3487

Closed dprochownik closed 7 years ago

dprochownik commented 7 years ago

How to properly sarialize/deserialize RefreshTokens to/from string?

I have to make my server "reboot safe" for already working applications and I want to implement my own RefreshTokenStore to allow refresh tokens survive a server restarts.

Unfortunately when I try to simple serialize them to JSON using Newtonsoft I'm getting error:

Self referencing loop detected for property 'Subject' with type 'System.Security.Claims.ClaimsIdentity'. Path 'AccessToken.Claims[10].Subject.Claims[0]'.

So my question is: what is the proper way to do that?

brockallen commented 7 years ago

You should look at our EF library for IS3: https://github.com/IdentityServer/IdentityServer3.EntityFramework

dprochownik commented 7 years ago

Thank you, I will do that