Skip to content
This repository was archived by the owner on Feb 21, 2020. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions App.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,11 @@ import jwtDecoder from 'jwt-decode';
to see what URL to add if the above is confusing.

If you use Facebook through Auth0, be sure to follow this guide: https://auth0.com/docs/connections/social/facebook

You also need to disable the OIDC Conformant flag from Auth0's config. (_Your App_ > Settings > Show Advanced Settings > OAuth > OIDC Conformant) for this to work.
*/
const auth0ClientId = '5SyUscgqrnRJ6WW3Evv5MIZZLfHOQtE9';
const auth0Domain = 'https://brentvatne.auth0.com';
const auth0ClientId = '5SyUscgqrnRJ6WW3Evv5MIZZLfHOQtE9';

/**
* Converts an object to a query string.
Expand All @@ -45,7 +47,7 @@ export default class App extends React.Component {
authUrl: `${auth0Domain}/authorize` + toQueryString({
client_id: auth0ClientId,
response_type: 'token',
scope: 'openid name',
scope: 'openid profile name',
redirect_uri: redirectUrl,
}),
});
Expand Down Expand Up @@ -115,4 +117,4 @@ const styles = StyleSheet.create({
textAlign: 'center',
marginTop: 40,
},
});
});
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ Try it at https://expo.io/@community/expo-auth0

## Setup

- Create your application client on https://auth0.com/
- In the application settings you need to add the [AuthSession docs](https://docs.expo.io/versions/latest/sdk/auth-session.html) callback url, which looks something like this: `https://auth.expo.io/@your-username/your-app-slug`. In the app code we have `https://auth.expo.io/@community/expo-auth0` because I am signed in as `@community` and the slug for this app is `expo-auth0`. You will need to replace `community` with your Expo username.
- Find references to `https://brentvatne.auth0.com/authorize` in `App.js` and replace it with the authorization endpoint for your Auth0 account, which you can see on your Auth0 dashboard.
1. Create your application client on https://auth0.com/
2. In the application settings you need to add the [AuthSession docs](https://docs.expo.io/versions/latest/sdk/auth-session.html) callback url, which looks something like this: `https://auth.expo.io/@your-username/your-app-slug`.
3. In the app code we have `https://auth.expo.io/@community/expo-auth0` because I am signed in as `@community` and the slug for this app is `expo-auth0`. (You will need to replace `community` with your Expo username.)

> **Note**: You need to **disable** the **OIDC Conformant** flag from Auth0's config. (_Your App_ > Settings > Show Advanced Settings > OAuth > OIDC Conformant) for this to work. Otherwise, the first token Auth0 sends is an `access_token` instead of the `id_token` we expect.