onedrive - How to refresh token from a windows service? -


is possible refresh token if application not have access browser control or http context? have winform logs user in , gets consent, passes token windows service files can uploaded onedrive. when token expires, seems methods refreshing token require callback url.

you can if you've requested wl.offline_access scope , you're using authorization code grant flow in oauth 2.0. once user has logged in through oauth, you'll receive access_token valid 1 hour, , refresh_token, valid long time.

each time service needs work on user's behalf, can redeem refresh_token new access_token , refresh_token, , use access_token work. make sure save new refresh_token well, make sure extend expiration.

this way can have service performs actions on behalf of user long time, without needing user sign in again. however, possible refresh_token expire or become invalid, need handle situations unable redeem refresh_token.


Comments

Popular posts from this blog

javascript - how to protect a flash video from refresh? -

android - Associate same looper with different threads -

visual studio 2010 - Connect to informix database windows form application -