Skip to content

Store CdsServiceClient between application restarts? #90

Answered by sergeytunnik
kirilvalev asked this question in Q&A
Discussion options

You must be logged in to vote

You can serialize token and store it in some kind of persistent storage (file, DB, etc).
Next initialize new CdsServiceClient instance with injecting token provider function which will deserialize it:
public CdsServiceClient(Uri instanceUrl, Func<string, Task<string>> tokenProviderFunction, bool useUniqueInstance = true)

Anyway token has lifetime which usually less than 24h. So if I logged in successfully today. Tomorrow by the time I will relaunch the app, the token will expire and I would have to enter credentials anyway.

Replies: 1 comment 1 reply

Comment options

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

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