Is there any way to create PnpContext from previous authentication? #512
Unanswered
gopaldahal
asked this question in
Q&A
Replies: 1 comment 6 replies
-
@gopaldahal : under the covers we use the MSAL library for authenticating and that library will handle token caching and refreshing, meaning the fact that you request an access token for a new site does not mean a server request...if MSAL still has a valid token cached you'll get that one back automatically. You can see this in the |
Beta Was this translation helpful? Give feedback.
6 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Currently PnPContext provide mechanism for getting token
var accessToken = pnpContext.Result.AuthenticationProvider.GetAccessTokenAsync(new Uri(siteUrl))
The same token can be used to create CSOM client context.
Means the token can be used to create CSOM context by saving it somewhere (until the token is expired) without reauthenticating the user.
Searching a similar way to use the same token or sth like that so that I don't need to regularly authenticate the user to create PnPContext
I might have missed the documentation.
Please help.
Sharing is Caring!!
Beta Was this translation helpful? Give feedback.
All reactions