You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/pages/[platform]/build-a-backend/auth/concepts/external-identity-providers/index.mdx
+154Lines changed: 154 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -387,6 +387,72 @@ await signInWithRedirect({
387
387
});
388
388
```
389
389
390
+
### Redirect URIs
391
+
392
+
For _Sign in Redirect URI(s)_ inputs, you can put one URI for local development and one for production. Example: `http://localhost:3000/` in dev and `https://www.example.com/` in production. The same is true for _Sign out Redirect URI(s)_.
393
+
394
+
If you have multiple redirect URI inputs, you'll need to pass them in your Amplify configuration. For example:
395
+
396
+
```javascript
397
+
Amplify.configure({
398
+
Auth: {
399
+
Cognito: {
400
+
loginWith: {
401
+
oauth: {
402
+
redirectSignIn: [
403
+
'http://localhost:3000/',
404
+
'https://www.example.com/'
405
+
],
406
+
redirectSignOut: [
407
+
'http://localhost:3000/',
408
+
'https://www.example.com/'
409
+
],
410
+
...oauthConfig
411
+
}
412
+
},
413
+
...userPoolConfig
414
+
}
415
+
}
416
+
});
417
+
```
418
+
419
+
#### Specifying a redirect URI on sign out
420
+
If you have multiple redirect urls configured, you may choose to override the default behavior of selecting a redirect url and provide the one of your choosing when calling `signOut`. The provided redirect url should match at least one of the configured redirect urls. If no redirect url is provided to `signOut`, one will be selected based on the current app domain.
@@ -430,6 +496,94 @@ When you import and use the `signInWithRedirect` function, it will add a listene
430
496
</Accordion>
431
497
</InlineFilter>
432
498
499
+
<InlineFilterfilters={["react-native"]}>
500
+
501
+
## Set up your frontend
502
+
503
+
<Calloutinfo>
504
+
505
+
If you are using the [Authenticator component](https://ui.docs.amplify.aws/react/connected-components/authenticator/configuration#external-providers) with Amplify, this feature works without any additional code. The guide below is for writing your own implementation.
506
+
507
+
</Callout>
508
+
509
+
Use the `signInWithRedirect` API to initiate sign-in with an external identity provider.
If you want to manually configure multiple _Sign in_ & _Sign out_ redirect URI(s), you'll need to pass them in your Amplify configuration. For example:
522
+
523
+
```javascript
524
+
Amplify.configure({
525
+
Auth: {
526
+
Cognito: {
527
+
loginWith: {
528
+
oauth: {
529
+
redirectSignIn: [
530
+
'myDevApp://'
531
+
],
532
+
redirectSignOut: [
533
+
'myDevApp://',
534
+
'myProdApp://'
535
+
],
536
+
...oauthConfig
537
+
}
538
+
},
539
+
...userPoolConfig
540
+
}
541
+
}
542
+
});
543
+
```
544
+
545
+
#### Specifying a redirect URI on sign out
546
+
If you have multiple redirect urls configured, you may choose to override the default behavior of selecting a redirect url and provide the one of your choosing when calling `signOut`. The provided redirect url should match at least one of the configured redirect urls. If no redirect url is provided to `signOut`, the first item from the the configured redirect urls list that does not contain a http nor https prefix will be picked.
<Callout> Irrespective of whether a `redirectUrl` is provided to `signOut`, a URL that does not contain http or https is expected to be present in the configured redirect URL list. This is because iOS requires an appScheme when creating the web session. </Callout>
584
+
585
+
</InlineFilter>
586
+
433
587
## Next steps
434
588
435
589
-[Learn how to sign in with external providers](/[platform]/build-a-backend/auth/connect-your-frontend/sign-in/#sign-in-with-an-external-identity-provider)
Copy file name to clipboardExpand all lines: src/pages/gen1/[platform]/build-a-backend/auth/add-social-provider/index.mdx
+1-3Lines changed: 1 addition & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -741,9 +741,7 @@ function App() {
741
741
742
742
### Redirect URIs
743
743
744
-
You can provide multiple _Sign in_ & _Sign out_ redirect URI(s).
745
-
746
-
If you have multiple redirect URI inputs, you'll need to pass them in your Amplify configuration. For example:
744
+
If you want to manually configure multiple _Sign in_ & _Sign out_ redirect URI(s), you'll need to pass them in your Amplify configuration. For example:
0 commit comments