nraina
nraina

Reputation: 354

Where should I store the access token from OAuth2 in a MVC application?

I have OAuth2 Authorization Layer and Service layer as part of my MVC application. The Access Token obtained from OAuth2 should be accessible to Service layer as medium to communicate to APIs. I was considering storing them to Session at class level, so, is this the right method or can I store them to some custom storage ?

Upvotes: 1

Views: 1484

Answers (1)

Eric Bole-Feysot
Eric Bole-Feysot

Reputation: 15107

You can add it as a claim.

manager.AddClaim(userId, new Claim("AccessToken", AccessToken));

Upvotes: 2

Related Questions