auth0 / auth0-flutter

Auth0 SDK for Flutter
https://pub.dev/documentation/auth0_flutter/latest/
Apache License 2.0
57 stars 36 forks source link

Credentials on Android have incorrect expiresAt value #427

Open aluu4445 opened 3 months ago

aluu4445 commented 3 months ago

Checklist

Description

When I login on Android, the returned Credentials object has an expiresAt value that is off by 7 hours.

Here is the relevant code snippet from the sample app with a print statement that I added:

      final result = await webAuth.login(
        redirectUrl: dotenv.env['AUTH0_REDIRECT_URI'],
        audience: dotenv.env['AUTH0_AUDIENCE'],
      );

      setState(() {
        _isLoggedIn = true;
      });

      output = result.idToken;
      print(result.expiresAt.difference(DateTime.now()));

I would expect this to be close to my access token lifetime of 5 minutes.

Here is the printed value that I get: -6:55:01.311274

Reproduction

  1. Login on Android
  2. Read the expiresAt value in the returned Credentials object
  3. Observe the difference between the expiresAt value and DateTime.now()

Additional context

No response

auth0_flutter version

1.6.0

Flutter version

3.16.9

Platform

Android

Platform version(s)

No response