Gurpreet Singh
Gurpreet Singh

Reputation: 165

Azure mobile service token expiration life

Here is my code that i am using for google authentication in xamarin forms development, after authentication i'm getting sid and token token, but token life is hardly 1 hour. Is there any way to increase the expiration time of token. If anybody knows please help me. Thank you in advance.

var user = await DependencyService.Get<IAuthentication>()
                 .LoginAsync(azureService.MobileService, provider);
if (user == null)
    return;
else
{
    await GetCurrentUserDetail(provider, Settings.AuthToken);
}

Upvotes: 2

Views: 154

Answers (1)

Chris Gillum
Chris Gillum

Reputation: 15052

You cannot increase the token life because it is tied to the token life of the Google id_token that is acquired by the mobile app backend during login. However, you do have the option to refresh this token so that you don't need to re-authenticate every hour. You can do so using the RefreshTokenAsync method in recent versions of the client SDK.

More background information can be found here: https://cgillum.tech/2016/03/07/app-service-token-store/

Upvotes: 2

Related Questions