Skip to content

Commit c863841

Browse files
josefaidtthisisabhashharsh62scanlonpjjarvisp
authored
Add passwordless (#8127)
* initial ia * concept boilerplate * add code snippet placeholders, cross links, warning for backend support * chore(auth): add swift passwordless sign up/auto sign in changes (#8128) * Apply suggestions from code review * rm comments, stale sections * chore: add new steps and new flow type * chore(auth): add swift passwordless sign in/web authn changes (#8131) * chore(auth): add swift passwordless sign in/web authn changes * removed unused section * remove flutter blocks * fix spelling * chore(auth): update swift passwordless autosignin Combine snippets (#8132) * chore(auth): add js passwordless changes (#8129) * chore(auth): add js passwordless changes * chore(auth): add filters and a react-native callout; code spacing * chore(auth): add sign in updates * Update src/pages/[platform]/build-a-backend/auth/manage-users/manage-webauthn-credentials/index.mdx Co-authored-by: James Jarvis <[email protected]> * chore(auth): add associate api to the manage webauthn page * Update src/pages/[platform]/build-a-backend/auth/connect-your-frontend/sign-in/index.mdx Co-authored-by: josef <[email protected]> * chore(auth): use string literals * chore(auth): add signin next step types * add js sign up examples * chore(auth): improve wording * chore(auth): add first factor selection to confirm sign-in next steps * Update src/pages/[platform]/build-a-backend/auth/connect-your-frontend/sign-in/index.mdx Co-authored-by: James Jarvis <[email protected]> * Update src/pages/[platform]/build-a-backend/auth/connect-your-frontend/sign-in/index.mdx Co-authored-by: James Jarvis <[email protected]> * chore(auth): review feedback - formatting and wording * chore(auth): move user auth flow info into switching flows page --------- Co-authored-by: James Jarvis <[email protected]> Co-authored-by: josef <[email protected]> * resolve structural issues * fix extra closing tag * filter passwordless blocks * Update src/pages/[platform]/build-a-backend/auth/concepts/passwordless/index.mdx * revert auth flow order change * update user auth flow description --------- Co-authored-by: Abhash Kumar Singh <[email protected]> Co-authored-by: Harsh <[email protected]> Co-authored-by: Parker Scanlon <[email protected]> Co-authored-by: James Jarvis <[email protected]>
1 parent b850c31 commit c863841

File tree

9 files changed

+1247
-6
lines changed

9 files changed

+1247
-6
lines changed

cspell.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1614,6 +1614,7 @@
16141614
"ampx",
16151615
"autodetection",
16161616
"jamba",
1617+
"webauthn",
16171618
"knowledgebases",
16181619
"rehype"
16191620
],

src/directory/directory.mjs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,9 @@ export const directory = {
7373
{
7474
path: 'src/pages/[platform]/build-a-backend/auth/concepts/phone/index.mdx'
7575
},
76+
{
77+
path: 'src/pages/[platform]/build-a-backend/auth/concepts/passwordless/index.mdx'
78+
},
7679
{
7780
path: 'src/pages/[platform]/build-a-backend/auth/concepts/user-attributes/index.mdx'
7881
},
@@ -137,6 +140,9 @@ export const directory = {
137140
{
138141
path: 'src/pages/[platform]/build-a-backend/auth/manage-users/manage-passwords/index.mdx'
139142
},
143+
{
144+
path: 'src/pages/[platform]/build-a-backend/auth/manage-users/manage-webauthn-credentials/index.mdx'
145+
},
140146
{
141147
path: 'src/pages/[platform]/build-a-backend/auth/manage-users/manage-devices/index.mdx'
142148
},
Lines changed: 147 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,147 @@
1+
import { getCustomStaticPath } from '@/utils/getCustomStaticPath';
2+
3+
export const meta = {
4+
title: 'Passwordless',
5+
description: 'Learn how to configure passwordless sign-in flows',
6+
platforms: [
7+
'android',
8+
'angular',
9+
'javascript',
10+
'nextjs',
11+
'react',
12+
'react-native',
13+
'swift',
14+
'vue'
15+
]
16+
};
17+
18+
export function getStaticPaths() {
19+
return getCustomStaticPath(meta.platforms);
20+
}
21+
22+
export function getStaticProps() {
23+
return {
24+
props: {
25+
meta
26+
}
27+
};
28+
}
29+
30+
Amplify supports the use of passwordless authentication flows using the following methods:
31+
32+
- [SMS-based one-time password (SMS OTP)](#sms-otp)
33+
- [Email-based one-time password (Email OTP)](#email-otp)
34+
- [WebAuthn passkey](#webauthn-passkey)
35+
36+
Passwordless authentication removes the security risks and user friction associated with traditional passwords.
37+
{/* add more color */}
38+
39+
<Callout warning>
40+
41+
**Warning:** Passwordless configuration is currently not available in `defineAuth`. We are currently working towards enabling support for passwordless configurations. [Visit the GitHub issue to track the progress](https://github.com/aws-amplify/amplify-backend/issues/2276)
42+
43+
</Callout>
44+
45+
{/* need a section about what a "preferred" factor is */}
46+
47+
## SMS OTP
48+
49+
SMS-based authentication uses phone numbers as the identifier and text messages as the verification channel. At a high level end users will perform the following steps to authenticate:
50+
51+
1. User enters their phone number to sign up/sign in
52+
2. They receive a text message with a time-limited code
53+
3. After the user enters their code they are authenticated
54+
55+
{/* quick blurb of basic usage */}
56+
<InlineFilter filters={["angular", "javascript", "nextjs", "react", "react-native", "vue"]}>
57+
58+
{/* */}
59+
60+
</InlineFilter>
61+
<InlineFilter filters={["android"]}>
62+
63+
{/* */}
64+
65+
</InlineFilter>
66+
67+
<InlineFilter filters={["swift"]}>
68+
69+
{/* */}
70+
71+
</InlineFilter>
72+
73+
<Callout info>
74+
75+
SMS-based one-time password requires your Amazon Cognito user pool to be configured to use Amazon Simple Notification Service (SNS) to send text messages. [Learn how to configure your auth resource with SNS](/[platform]/build-a-backend/auth/moving-to-production/#sms).
76+
77+
{/* NOTE the linked page will need to be updated with sns instructions */}
78+
79+
</Callout>
80+
81+
[Learn more about using SMS OTP in your application code](/[platform]/build-a-backend/auth/connect-your-frontend/sign-in/#sms-otp).
82+
83+
## Email OTP
84+
85+
Email-based authentication uses email addresses for identification and verification. At a high level end users will perform the following steps to authenticate:
86+
87+
1. User enters their email address to sign up/sign in
88+
2. They receive an email message with a time-limited code
89+
3. After the users enters their code they are authenticated
90+
91+
{/* quick blurb of basic usage */}
92+
<InlineFilter filters={["angular", "javascript", "nextjs", "react", "react-native", "vue"]}>
93+
94+
{/* */}
95+
96+
</InlineFilter>
97+
<InlineFilter filters={["android"]}>
98+
99+
{/* */}
100+
101+
</InlineFilter>
102+
<InlineFilter filters={["swift"]}>
103+
104+
{/* */}
105+
106+
</InlineFilter>
107+
108+
<Callout info>
109+
110+
Email-based one-time password requires your Amazon Cognito user pool to be configured to use Amazon Simple Email Service (SES) to send email messages. [Learn how to configure your auth resource with SES](/[platform]/build-a-backend/auth/moving-to-production/#email).
111+
112+
</Callout>
113+
114+
[Learn more about using email OTP in your application code](/[platform]/build-a-backend/auth/connect-your-frontend/sign-in/#email-otp).
115+
116+
## WebAuthn Passkey
117+
118+
WebAuthn uses biometrics or security keys for authentication, leveraging device-specific security features. At a high level end users will perform the following steps to authenticate:
119+
120+
1. User chooses to register a passkey
121+
2. Their device prompts for biometric/security key verification
122+
3. For future logins, they'll authenticate using the same method
123+
124+
{/* quick blurb of basic usage */}
125+
<InlineFilter filters={["angular", "javascript", "nextjs", "react", "react-native", "vue"]}>
126+
127+
{/* */}
128+
129+
</InlineFilter>
130+
<InlineFilter filters={["android"]}>
131+
132+
{/* */}
133+
134+
</InlineFilter>
135+
<InlineFilter filters={["swift"]}>
136+
137+
{/* */}
138+
139+
</InlineFilter>
140+
141+
[Learn more about using WebAuthn passkeys in your application code](/[platform]/build-a-backend/auth/connect-your-frontend/sign-in/#webauthn-passkeys).
142+
143+
### Managing credentials
144+
145+
{/* quick blurb then segue over to "manage WebAuthn credentials" page */}
146+
147+
[Learn more about managing WebAuthn credentials](/[platform]/build-a-backend/auth/manage-users/manage-webauthn-credentials).

src/pages/[platform]/build-a-backend/auth/connect-your-frontend/multi-step-sign-in/index.mdx

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2030,6 +2030,19 @@ func signIn(username: String, password: String) async {
20302030
20312031
// Prompt the user to enter the Email MFA code they received
20322032
// Then invoke `confirmSignIn` api with the code
2033+
2034+
case .continueSignInWithFirstFactorSelection(let allowedFactors):
2035+
print("Received next step as continue sign in by selecting first factor")
2036+
print("Allowed factors \(allowedFactors)")
2037+
2038+
// Prompt the user to select the first factor they want to use
2039+
// Then invoke `confirmSignIn` api with the factor
2040+
2041+
case .confirmSignInWithPassword:
2042+
print("Received next step as confirm sign in with password")
2043+
2044+
// Prompt the user to enter the password
2045+
// Then invoke `confirmSignIn` api with the password
20332046
20342047
case .continueSignInWithTOTPSetup(let setUpDetails):
20352048
print("Received next step as continue sign in by setting up TOTP")

0 commit comments

Comments
 (0)