Flutter Auth0 - AuthTokens expiry date

I have an application working with Flutter using the Auth0 code provided.

web3auth_flutter: ^3.1.6

I have followed this post below and created an API application in Auth0 however the oAuthAccessToken that is returned is only 24 hours (bottom value browser flows) not top value.

I don’t want the user to keep having to logout and login to the app so want a longer period than 24 hours

Future _withAuth0() {
return Web3AuthFlutter.login(
LoginParams(
loginProvider: Web3AuthEnums.Provider.jwt,
extraLoginOptions: ExtraLoginOptions(
domain: ‘https://MY_AUTH0_URL’,
audience: ‘https://MY_API_IDENTIFIER’,
verifierIdField: ‘sub’,
),
),
);
}
}

hi @chris4,

Your issue has been forwarded to our team and we will get back with further updates.

1 Like

Hey @chris4, you don’t need to update any thing in the Auth0 for extending the user session with Web3Auth. You can checkout our documentation for refresh token and session management.

Since, you are using Flutter SDK, you can use the sessionTime parameter in Web3AuthOptions to extend the session.

await Web3AuthFlutter.init(
      Web3AuthOptions(
        clientId: 'Your Client id',
        network: Network.sapphire_mainnet,
        redirectUrl: redirectUrl,
        loginConfig: loginConfig,
        // 259200 allows user to stay authenticated for 3 days with Web3Auth.
        // Default is 86400, which is 1 day.
        sessionTime: 259200,
      ),
    );

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.