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
To sign in using an external identity provider such as Google, use the `signInWithRedirect` function.
848
851
849
852
### Install native module
850
853
@@ -883,6 +886,8 @@ Add the `intent-filter` to your application's main activity, replacing `myapp` w
883
886
884
887
</InlineFilter>
885
888
<InlineFilterfilters={['flutter']}>
889
+
To sign in using an external identity provider such as Google, use the `signInWithWebUI` function.
890
+
886
891
### How It Works
887
892
888
893
Sign-in with web UI will display the sign-in UI inside a webview. After the sign-in process is complete, the sign-in UI will redirect back to your app.
To sign in using an external identity provider such as Google, use the `signInWithWebUI` function.
1047
+
1048
+
### Update Info.plist
1038
1049
1039
1050
Sign-in with web UI requires the Amplify plugin to show up the sign-in UI inside a webview. After the sign-in process is complete it will redirect back to your app.
1040
1051
You have to enable this in your app's `Info.plist`. Right click Info.plist and then choose Open As > Source Code. Add the following entry in the URL scheme:
@@ -1064,7 +1075,7 @@ You have to enable this in your app's `Info.plist`. Right click Info.plist and t
1064
1075
1065
1076
When creating a new SwiftUI app using Xcode 13 no longer require configuration files such as the Info.plist. If you are missing this file, click on the project target, under Info, Url Types, and click '+' to add a new URL Type. Add `myapp` to the URL Schemes. You should see the Info.plist file now with the entry for CFBundleURLSchemes.
1066
1077
1067
-
## Launch Social Web UI Sign In
1078
+
###Launch Social Web UI Sign In
1068
1079
1069
1080
Invoke the following API with the provider you're using (shown with Facebook below):
To request an OTP code via SMS for authentication, you must pass the SMS auth factor type (`AuthFactorType.SMS_OTP`) to the `confirmSignIn` API.
1154
+
To request an OTP code via SMS for authentication, you pass the `challengeResponse` for `AuthFactorType.SMS_OTP` to the `confirmSignIn` API.
1144
1155
1145
1156
Amplify will respond appropriately to Cognito and return the challenge as the sign in next step: `CONFIRM_SIGN_IN_WITH_OTP_CODE`. You will call `confirmSignIn` again, this time with the OTP that your user provides.
1146
1157
@@ -1150,7 +1161,7 @@ Amplify will respond appropriately to Cognito and return the challenge as the si
1150
1161
```java
1151
1162
// First confirm the challenge type
1152
1163
Amplify.Auth.confirmSignIn(
1153
-
AuthFactorType.SMS_OTP.name(),
1164
+
AuthFactorType.SMS_OTP.getChallengeResponse(),
1154
1165
result -> {
1155
1166
if (result.getNextStep().getSignInStep() ==AuthSignInStep.CONFIRM_SIGN_IN_WITH_OTP) {
1156
1167
// Show UI to collect OTP
@@ -1175,7 +1186,7 @@ Amplify.Auth.confirmSignIn(
1175
1186
```kotlin
1176
1187
// First confirm the challenge type
1177
1188
Amplify.Auth.confirmSignIn(
1178
-
AuthFactorType.SMS_OTP.name,
1189
+
AuthFactorType.SMS_OTP.challengeResponse,
1179
1190
{ result ->
1180
1191
if (result.nextStep.signInStep ==AuthSignInStep.CONFIRM_SIGN_IN_WITH_OTP) {
1181
1192
// Show UI to collect OTP
@@ -1203,7 +1214,7 @@ Amplify.Auth.confirmSignIn(
1203
1214
1204
1215
```kotlin
1205
1216
// First confirm the challenge type
1206
-
var result =Amplify.Auth.confirmSignIn(AuthFactorType.SMS_OTP.name)
1217
+
var result =Amplify.Auth.confirmSignIn(AuthFactorType.SMS_OTP.challengeResponse)
1207
1218
if (result.nextStep.signInStep ==AuthSignInStep.CONFIRM_SIGN_IN_WITH_OTP) {
1208
1219
// Show UI to collect OTP
1209
1220
}
@@ -1219,7 +1230,7 @@ result = Amplify.Auth.confirmSignIn("123456")
To request an OTP code via email for authentication, you must pass the email auth factor type (`AuthFactorType.EMAIL_OTP`) to the `confirmSignIn` API.
1358
+
To request an OTP code via email for authentication, you pass the `challengeResponse` for `AuthFactorType.EMAIL_OTP` to the `confirmSignIn` API.
1348
1359
1349
1360
Amplify will respond appropriately to Cognito and return the challenge as the sign in next step: `CONFIRM_SIGN_IN_WITH_OTP_CODE`. You will call `confirmSignIn` again, this time with the OTP that your user provides.
1350
1361
@@ -1354,7 +1365,7 @@ Amplify will respond appropriately to Cognito and return the challenge as the si
1354
1365
```java
1355
1366
// First confirm the challenge type
1356
1367
Amplify.Auth.confirmSignIn(
1357
-
AuthFactorType.EMAIL_OTP.name(),
1368
+
AuthFactorType.EMAIL_OTP.getChallengeResponse(),
1358
1369
result -> {
1359
1370
if (result.getNextStep().getSignInStep() ==AuthSignInStep.CONFIRM_SIGN_IN_WITH_OTP) {
1360
1371
// Show UI to collect OTP
@@ -1379,7 +1390,7 @@ Amplify.Auth.confirmSignIn(
1379
1390
```kotlin
1380
1391
// First confirm the challenge type
1381
1392
Amplify.Auth.confirmSignIn(
1382
-
AuthFactorType.EMAIL_OTP.name,
1393
+
AuthFactorType.EMAIL_OTP.challengeResponse,
1383
1394
{ result ->
1384
1395
if (result.nextStep.signInStep ==AuthSignInStep.CONFIRM_SIGN_IN_WITH_OTP) {
1385
1396
// Show UI to collect OTP
@@ -1407,7 +1418,7 @@ Amplify.Auth.confirmSignIn(
1407
1418
1408
1419
```kotlin
1409
1420
// First confirm the challenge type
1410
-
var result =Amplify.Auth.confirmSignIn(AuthFactorType.EMAIL_OTP.name)
1421
+
var result =Amplify.Auth.confirmSignIn(AuthFactorType.EMAIL_OTP.challengeResponse)
1411
1422
if (result.nextStep.signInStep ==AuthSignInStep.CONFIRM_SIGN_IN_WITH_OTP) {
1412
1423
// Show UI to collect OTP
1413
1424
}
@@ -1423,7 +1434,7 @@ result = Amplify.Auth.confirmSignIn("123456")
To sign in with WebAuthn, you pass the `challengeResponse` for `AuthFactorType.WEB_AUTHN` to the `confirmSignIn` API. Amplify will invoke Android's Credential Manager to retrieve a PassKey, and the user will be shown a system UI to authorize the PassKey access. This flow
1562
+
completes without any additional interaction from your application, so there is only one `confirmSignIn` call needed for WebAuthn.
1563
+
1564
+
<Callout>
1565
+
Amplify requires an `Activity` reference to attach the PassKey UI to your Application's [Task](https://developer.android.com/guide/components/activities/tasks-and-back-stack) when using WebAuthn - if an `Activity` is not supplied then the UI will appear in a separate Task. For this reason, we strongly recommend passing the `callingActivity` option to both the `signIn` and `confirmSignIn` APIs if your application uses the `USER_AUTH` flow.
result ->Log.i("AuthQuickStart", "Next sign in step: "+ result.getNextStep()),
1638
+
error ->Log.e("AuthQuickstart", "Failed to sign in", error)
1639
+
);
1640
+
```
1641
+
1642
+
</Block>
1643
+
</BlockSwitcher>
1644
+
1645
+
Using WebAuthn sign in may result in a number of possible exception types.
1646
+
1647
+
-`UserCancelledException` - If the user declines to authorize access to the PassKey in the system UI. You can retry the WebAuthn flow by invoking `confirmSignIn` again, or restart the `signIn` process to select a different `AuthFactorType`.
1648
+
-`WebAuthnNotEnabledException` - This indicates WebAuthn is not enabled in your user pool.
1649
+
-`WebAuthnNotSupportedException` - This indicates WebAuthn is not supported on the user's device.
1650
+
-`WebAuthnRpMismatchException` - This indicates there is a problem with the `assetlinks.json` file deployed to your relying party.
1651
+
-`WebAuthnFailedException` - This exception is used for other errors that may occur with WebAuthn. Inspect the `cause` to determine the best course of action.
Traditional password based authentication is available from this flow as well. To initiate this flow from select challenge, either `PASSWORD` or `PASSWORD_SRP` is passed as the challenge response.
1669
+
Traditional password based authentication is available from the `USER_AUTH` flow as well. To initiate this flow from select challenge, either `PASSWORD` or `PASSWORD_SRP` is passed as the challenge response.
0 commit comments