poeta_auth0_client 0.1.1 copy "poeta_auth0_client: ^0.1.1" to clipboard
poeta_auth0_client: ^0.1.1 copied to clipboard

A new Flutter library for Poeta Digital can apply Auth0 as soon as possible.

poeta_auth0_client #

A new Flutter library for Poeta Digital can apply Auth0 as soon as possible.

Usage #

auth0_client has a narrow and user-friendly API.

See the auth0_example for additional examples.

For example initial auth0_client with a method:

const AUTH0_DOMAIN = 'dev-mpl7u4pn.auth0.com';
const AUTH0_CLIENT_ID = 'Fg52qlqEGpvTp8C0RvUVk3x5ZHoQMu0q';
const AUTH0_REDIRECT_URI = 'com.poetadigital.auth0://callback';

void main() {
  Auth0Client.initial(AUTH0_DOMAIN, AUTH0_CLIENT_ID, AUTH0_REDIRECT_URI);
  runApp(MyApp());
}

How to integrate Login Api to project

Future<void> loginAction() async {
    try {
      final decodedToken = await Auth0Client.login();
      setState(() {
        isLoggedIn = true;
        name = decodedToken['name'];
        picture = decodedToken['picture'];
      });
    } catch (e) {
      setState(() {
              isLoggedIn = false;
              errorMessage = e.toString();
            });
    }
  }

How to integrate Logout Api to project

void logoutAction() async {
    await Auth0Client.logout();
    setState(() {
      isLoggedIn = false;
    });
  }

Contributing #

0
likes
30
pub points
0%
popularity

Publisher

unverified uploader

A new Flutter library for Poeta Digital can apply Auth0 as soon as possible.

Repository (GitHub)
View/report issues

License

BSD-3-Clause (LICENSE)

Dependencies

connectivity, cupertino_icons, dio, flutter, flutter_appauth, flutter_secure_storage, jwt_decoder

More

Packages that depend on poeta_auth0_client