A RefreshTokenProvider using Redis as token store.
To install Owin.Security.RedisTokenProviders
Install-Package Owin.Security.RedisTokenProviders
Set RefreshTokenProvider property of OAuthAuthorizationServerOptions
OAuthOptions = new OAuthAuthorizationServerOptions
{
//Other configurations
RefreshTokenProvider = new RedisRefreshTokenProvider(new ProviderConfiguration
{
Db = 0,
ExpiresUtc = DateTime.UtcNow.AddYears(1),
Port = 6379,
Host = "localhost",
AbortOnConnectFail =true //Optional (default:true)
})
{
RedisKeyGenerator = (authenticationTicket, token) => token, // Optional
RefreshTokenGenerator = () => Guid.NewGuid().ToString() // Optional
}
};
- StackExchange.Redis by StackExchange