Skip to content

Commit fcd95ee

Browse files
Add Skip the Auth0 login page to FAQ (#661)
2 parents 81dd79c + 2774d88 commit fcd95ee

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

FAQ.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
7. [Using the SDK with Angular Universal](#7-using-the-sdk-with-angular-universal)
1212
8. [Retrieving and refreshing a token](#8-retrieving-and-refreshing-a-token)
1313
9. [When using localOnly logout, the user is getting logged in again](#9-when-using-localonly-logout-the-user-is-getting-logged-in-again)
14+
9. [Skip the Auth0 login page?](#10-skip-the-auth0-login-page)
1415

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

@@ -288,3 +289,35 @@ providers: [
288289
}
289290
],
290291
```
292+
293+
## 10. Skip the Auth0 login page
294+
295+
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.
296+
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()`:
297+
298+
```
299+
this.auth.loginWithRedirect({
300+
// ...
301+
authorizationParams: {
302+
connection: 'connection_logical_identifier'
303+
}
304+
})
305+
```
306+
307+
Doing so for connections such as Google or Microsoft, would automatically redirect you to them instead of showing the Auth0 login page first.
308+
309+
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:
310+
311+
```
312+
bootstrapApplication(AppComponent, {
313+
providers: [
314+
provideAuth0({
315+
authorizationParams: {
316+
connection: 'connection_logical_identifier'
317+
}
318+
}),
319+
]
320+
});
321+
```
322+
323+
ℹ️ You can find the connection's logical identifier as the **connection name** in the connection settings in the Auth0 dashboard for your tenant.

0 commit comments

Comments
 (0)