Back

Unable to use account.updateSession() method for refreshing access token.

  • 1
  • Flutter
Mandeep Singh
27 Sep, 2023, 14:35

I am using Flutter appwrite SDK for Google oauth signin. Code: // For signin with google await _account.createOAuth2Session(provider: 'google'); // For getting current session final session = await _account.getSession(sessionId: 'current'); print('Refresh token: ' + session.providerRefreshToken); // Here Refresh token is empty

// For refreshing accesstokens await _account.updateSession(sessionId: 'current'); // This throws error: invalid_request: Missing required parameter: refresh_token

Output: I/flutter (23510): Refresh token: I/flutter (23510): invalid_request: Missing required parameter: refresh_token

TL;DR
User is unable to use the account.updateSession() method for refreshing access tokens in a Flutter app using the Appwrite SDK for Google OAuth signin. The refresh token is empty and the method throws an error: "invalid_request: Missing required parameter: refresh_token".
Drake
27 Sep, 2023, 20:28

FYI, it's best to wrap code in backticks to format a bit nicer. You can use 1 backtick for inline code (https://www.markdownguide.org/basic-syntax/#code) and 3 backticks for multiline code (https://www.markdownguide.org/extended-syntax/#syntax-highlighting.

Drake
27 Sep, 2023, 20:36

ya i don't think you can refresh a google session at the moment. See related issue: https://github.com/appwrite/appwrite/issues/5987

Mandeep Singh
28 Sep, 2023, 15:39

Ok Thank you sir

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more