private async Task <string> GenerateAccessTokenAsync(OioIdwsMatchEndpointContext context, OioIdwsToken storedToken) { var uniqueKey = _keyGenerator.GenerateUniqueKey(); _logger.WriteEntry(Log.NewUniqueKeyGenerated(uniqueKey)); await _securityTokenStore.StoreTokenAsync(uniqueKey, storedToken); _logger.WriteVerbose("Token information was committed to the Token Store"); //store the Expiry time directly in the protected access token, allowing the Authorization Server to quickly validate the token when asked to retrieve information var properties = new AuthenticationProperties { ExpiresUtc = storedToken.ExpiresUtc }; properties.Value(uniqueKey); var accessToken = context.Options.TokenDataFormat.Protect(properties); return(accessToken); }