Here is a short answer, I have it all the time. OAuthBearerTokenOptions contains the code needed to create the token. It should be configured in your owin run.
app.UseOAuthBearerAuthentication(OAuthBearerOptions);
Given that ...
var ticket = new AuthenticationTicket(identity, new AuthenticationProperties()); var currentUtc = new SystemClock().UtcNow; ticket.Properties.IssuedUtc = currentUtc; ticket.Properties.ExpiresUtc = currentUtc.Add(TimeSpan.FromMinutes(expirationMinutes)); string accessToken = oAuthBearerAuthenticationOptions.AccessTokenFormat.Protect(ticket);
source share