Skip to content

Commit

Permalink
Update readmes, add preconfigured auth0 app
Browse files Browse the repository at this point in the history
  • Loading branch information
Greger Wedel committed Jul 4, 2019
1 parent c7bd5c8 commit e0fa12c
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 8 deletions.
3 changes: 3 additions & 0 deletions README.md
Expand Up @@ -10,6 +10,9 @@ Note: This plugin is still under development, and some APIs might not be availab
<img src="screenshots/flutter_03.png" alt="screen_02" height="300" />
</div>

## Example app in this project
In the example/ folder, you will find a test application. See README.md there.

## Authentication API
### Usage
To use this plugin, add `flutter_auth0` as a [dependency in your pubspec.yaml file](https://flutter.io/platform-plugins/).
Expand Down
20 changes: 15 additions & 5 deletions example/README.md
@@ -1,8 +1,18 @@
# flutter_auth0
# flutter_auth0 Example

A new Flutter project.
A test app for flutter_auth0

## Getting Started
## Create a test app in auth0

For help getting started with Flutter, view our online
[documentation](https://flutter.io/).
Create a new test app in auth0 dashboard. An Auth0 app allows different types of
authentication flows. To test the basic signup and signin using password, you have to
choose app type Regular web application, choose None as Token Endpoint Authentication Method,
and under Advanced - Grant Types tick off Password as an allowed type.

To test the web login, you also need to configure callback URLs as described in the main README.

## Configure the example app

In example/lib/main.dart, you need to update clientId and domain constants. The already configured id and
domain belongs to a test app (github.com/gregertw) that you may use (NOTE! You need to use a real email
address and the user will show up in the auth0 dashboard of this app).
10 changes: 7 additions & 3 deletions example/lib/main.dart
Expand Up @@ -3,8 +3,8 @@ import 'dart:async';
import 'package:flutter/material.dart';
import 'package:flutter_auth0/flutter_auth0.dart';

final String clientId = 'your-client-id';
final String domain = 'your-domain';
final String clientId = 't_H_DVN6E3Mumz9-2U_AqkgDBpXkCea_';
final String domain = 'actingweb.eu.auth0.com';

final Auth0 auth = new Auth0(clientId: clientId, domain: domain);
final WebAuth web = new WebAuth(clientId: clientId, domain: domain);
Expand Down Expand Up @@ -49,7 +49,11 @@ class _MyHomePageState extends State<MyHomePage> {
waitResponse: true);
return '''[Sign-Up Success]
User Id: ${user['_id']}''';
} catch (e) {
}
on NullThrownError {
return 'Unknown error, user may already exist';
}
catch (e) {
return e;
}
}
Expand Down

0 comments on commit e0fa12c

Please sign in to comment.