For AI agents: a documentation index is available at /llms.txt. A markdown version of this page is available at the same URL with .md appended (or via Accept: text/markdown).
Skip to main content

Get identity token

Use the getIdentityToken method to retrieve the identity token (OIDC ID token) for the user's current auth session. You can send this token to your backend to verify the user. See ID token and server-side verification.

This method is available from v8.

Usage​

try {
final String idToken = await Web3AuthFlutter.getIdentityToken();
} catch (e) {
// Thrown when no authenticated session is present.
log(e.toString());
}

Errors​

getIdentityToken throws when no authenticated session is present.

On this page