Question regarding credential management

I would just like to know, in the event that a user adds multiple accounts for one cloud service, how is the management of credentials handled? I see that even if you sign out of one account or even both, I still have access to the files in odrive for both accounts. Is the session information for each account being stored somewhere?

Disregard, I answered my own question.

public class AccountController : Controller, IRefreshTokenHandler
{
Task IRefreshTokenHandler.SaveRefreshTokenAsync(RefreshTokenInfo tokenInfo)
{
await SaveRefreshTokenToDBForCurrentUserAsync(tokenInfo);
}

Task<RefreshTokenInfo> IRefreshTokenHandler.RetrieveRefreshTokenAsync()
{
    return await RetrieveRefreshTokenFromDBForCurrentUserAsync();
}

public async Task<ActionResult> Refresh()
{
    try
    {
         LiveAuthClient liveAuthClient = new LiveAuthClient(ClientId, ClientSecret, RedirectURL, this);
         LiveLoginResult result = await liveAuthClient.InitializeSessionAsync(this.HttpContext);
         session = result.Session;
    }
    catch (LiveAuthException)
    {
    }

    return View();
}

}

Yup.
We use the standard OAuth2 authentication scheme to retrieve access tokens with the authorized refresh token. Of course, this can only be done after you’ve authorized that relationship during sign-in or linking. The code you posted from Microsoft’s site goes through the basics of that.

1 Like

Thanks for verifying :slight_smile: