Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/anthonychwong/auth0-flutter-web

Wrapper of Auth0 SPA SDK for Flutter Web
https://github.com/anthonychwong/auth0-flutter-web

auth0 auth0-spa-js dart

Last synced: 4 months ago
JSON representation

Wrapper of Auth0 SPA SDK for Flutter Web

Awesome Lists containing this project

README

        

# Auth0 Flutter Web

A wrapper for Auth0 SPA SDK to use Auth0 in Flutter Web.

> ⚠ The latest is [`0.0.1-alpha.6`](https://pub.dev/packages/auth0_flutter_web/versions/0.0.1-alpha.6) but not serve by `pub.dev` by default.

[![](https://img.shields.io/pub/v/auth0_flutter_web)](https://pub.dev/packages/auth0_flutter_web)

## How to use

### 1. Add dependency

```yaml
dependencies:
auth0_flutter_web:
```

### 2. Load Auth0 SPA SDK in `index.html`

Make Auth0 SPA SDK available for dart by adding it to `index.html` in `web` folder (besides `ios` and `android`)

```HTML





```

### 3. Use `Auth0` in dart code

```dart
import 'package:auth0_flutter_web/auth0_flutter_web.dart';

Auth0 auth0 = await createAuth0Client(
Auth0CreateOptions(
domain: '-- domain of the universal login page --',
client_id: '-- id of your app --',
)
);

String token = await auth0.getTokenWithPopup();
```

## Example

Complete source code of working example can be found in `example` folder under repository `root`