Skip to content
This repository has been archived by the owner on Aug 2, 2024. It is now read-only.

How to Implement Token Refresh with Microsoft.Datasync.Client Similar to Microsoft.Azure.Mobile.Client Approach #904

Discussion options

You must be logged in to vote

The GenericAuthenticationProvider uses a caching algorithm. When the token is just about to expire, it asks for another one. Underneath, it is a DelegatingHandler that adds the current token to the request as an Authorization header.

What you SHOULD do is understand the AuthenticationProvider (the GenericAuthenticationProvider inherits from this) and do "whatever your authentication mechanism requires" to get a token and keep it fresh. For 90+% of cases, the GenericAuthenticationProvider is enough, but it's definitely not "all cases" and for those where you want to specifically do something else, there is a skeleton for you to use as the basis for your own authentication provider.

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@adrianhall
Comment options

Answer selected by rajagopalannairr
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants