Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added solutions to common issues in auth0 README #1021

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
34 changes: 34 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -493,6 +493,40 @@ try {
}
```

#### Malformed Access Tokens

If a JWT access token returned by `getCredentials()` is malformed, you may have created an *opaque access token*, which is a token without an audience. In your `authorize()` function call be sure to specify `audience: {your audience}` to prevent malformed access tokens. You can find your application's audience in the auth0 webpage under "Applications" -> "APIs" -> "Auth0 Management API".

#### Prompting Login Page versus Signup Page

If your application has one button for logging in and one button for signing up, you can prompt Auth0 to direct the user to the appropriate authentication page as such:

```
const login = async () => {
await authorize({
scope: ...,
audience: ...,
additionalParameters: {
prompt: 'select_account',
screen_hint: 'login'
}
});
// continue with login process!
}

const signup = async () => {
await authorize({
scope: ...,
audience: ...,
additionalParameters: {
prompt: 'select_account',
screen_hint: 'signup'
}
});
// continue with signup process!
}
```

## Feedback

### Contributing
Expand Down