auth0_web_auth 1.0.0 copy "auth0_web_auth: ^1.0.0" to clipboard
auth0_web_auth: ^1.0.0 copied to clipboard

Platformweb
outdated

This package provides a Dart wrapper around the auth0-spa-js library, making the Auth0 authentication available on Flutter Web.

This package is a Dart wrapper around the official auth0-spa-js JavaScript package. It enables adding Auth0 authentication to Flutter Web Apps without writing a standalone authentication library in Dart.

Features #

  • Authentication with Auth0 using PKCE
  • Securing the app with Refresh Tokens
  • Use the returned access token to access a protected resource (eg. backend server)

Usage #

var auth0client = await Auth0.create(Auth0ClientOptions(
  domain: example-domain.eu.auth0.com, // Your domain
  clientId: asdfgh123456, // Your client id
  redirectUri: http://example.com, // Your redirect URI
  audience: https://example/api, // Your audience
  useRefreshTokens: true, // Use refresh tokens instead of cookie-based validation
  cacheLocation: 'localstorage' // Store the tokens in local storage, default is in-memory
));

auth0client.loginWithRedirect(
  RedirectLoginOptions(uiLocales: locale ?? languageCode)
);

_client.handleRedirectCallbackWithQuery('query');

Additional information #

Feel free to contribute to the package and file bug reports on the official repository.

0
likes
110
points
63
downloads

Publisher

unverified uploader

Weekly Downloads

This package provides a Dart wrapper around the auth0-spa-js library, making the Auth0 authentication available on Flutter Web.

Repository (GitHub)
View/report issues
Contributing

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

flutter, js, universal_html

More

Packages that depend on auth0_web_auth