auth0_flutter2 0.0.1 auth0_flutter2: ^0.0.1 copied to clipboard
A Flutter package to easily integrate Auth0 into Android, iOS, and Web Flutter apps.
A Flutter package to easily integrate Auth0 into Android, iOS, and Web Flutter apps.
Platform Support #
Android | iOS | MacOS | Web | Linux | Windows |
---|---|---|---|---|---|
✔️ | ✔️ | x | ✔️ | x | x |
Auth0Flutter2 is not supported on MacOS, Windows, or Linux.
Features #
Integrate Auth0 authentication across mobile and web Flutter apps. Login users, logout users, and identify currently authenticated users across web and mobile.
Usage #
To use this plugin, add auth0_flutter2
as a dependency in your pubspec.yaml file.
iOS and Android #
Follow the iOS and Android usage instructions in the official Auth0 mobile package
Web #
For Web support add the Auth0 Javascript SPA (Single Page Application) library.
<script src="https://cdn.auth0.com/js/auth0-spa-js/1.13/auth0-spa-js.production.js"></script>
Example #
Import the library.
import 'package:auth0_flutter2/auth0_flutter2.dart';
Then initialize the Auth0Flutter2
class in your main()
method.
void main() {
Auth0Flutter2.auth0Domain = Globals.AUTH0_DOMAIN;
Auth0Flutter2.auth0ClientId = Globals.AUTH0_CLIENT_ID;
runApp(const MyApp());
}
Then invoke the class methods anywhere in your Dart code.
Auth0Flutter2.instance.loginUser();
Auth0Flutter2.instance.logoutUser();
Auth0Flutter2.instance.getLoggedInUserId();