Skip to content

Commit

Permalink
Add Skip the Auth0 login page to FAQ (auth0#661)
Browse files Browse the repository at this point in the history
  • Loading branch information
tusharpandey13 authored Dec 23, 2024
2 parents 81dd79c + 2774d88 commit fcd95ee
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions FAQ.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
7. [Using the SDK with Angular Universal](#7-using-the-sdk-with-angular-universal)
8. [Retrieving and refreshing a token](#8-retrieving-and-refreshing-a-token)
9. [When using localOnly logout, the user is getting logged in again](#9-when-using-localonly-logout-the-user-is-getting-logged-in-again)
9. [Skip the Auth0 login page?](#10-skip-the-auth0-login-page)

## 1. User is not logged in after page refresh

Expand Down Expand Up @@ -288,3 +289,35 @@ providers: [
}
],
```

## 10. Skip the Auth0 login page

When integrating with third party providers such as Google or Microsoft, being redirected to Auth0 before being redirected to the corresponding provider can be sub-optimal in terms of user-experience.
If you only have a single connection enabled, or you know up front how the user wants to authenticate, you can set the `connection` parameter when calling `loginWithRedirect()` or `loginWithPopup()`:

```
this.auth.loginWithRedirect({
// ...
authorizationParams: {
connection: 'connection_logical_identifier'
}
})
```

Doing so for connections such as Google or Microsoft, would automatically redirect you to them instead of showing the Auth0 login page first.

Additionally, if you are using our AuthGuard, you may want it to pick up the same connection when it would redirect for login. To do so, you should provide the `connection` property when configuring Auth0:

```
bootstrapApplication(AppComponent, {
providers: [
provideAuth0({
authorizationParams: {
connection: 'connection_logical_identifier'
}
}),
]
});
```

ℹ️ You can find the connection's logical identifier as the **connection name** in the connection settings in the Auth0 dashboard for your tenant.

0 comments on commit fcd95ee

Please sign in to comment.