-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore(auth): add js passwordless changes #8129
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking pretty good... will take a closer look later. Just that one suggestion for now.
src/pages/[platform]/build-a-backend/auth/manage-users/manage-webauthn-credentials/index.mdx
Outdated
Show resolved
Hide resolved
src/pages/[platform]/build-a-backend/auth/connect-your-frontend/sign-in/index.mdx
Outdated
Show resolved
Hide resolved
…webauthn-credentials/index.mdx Co-authored-by: James Jarvis <[email protected]>
username: state.username, | ||
password: state.password, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we use placeholder strings for these?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you mean a variable with a placeholder string or string literals with a consistent placeholder string?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
string literals, similar to https://docs.amplify.aws/react/build-a-backend/auth/connect-your-frontend/sign-in/#using-the-signin-api
src/pages/[platform]/build-a-backend/auth/connect-your-frontend/sign-in/index.mdx
Outdated
Show resolved
Hide resolved
…d/sign-in/index.mdx Co-authored-by: josef <[email protected]>
src/pages/[platform]/build-a-backend/auth/connect-your-frontend/sign-in/index.mdx
Show resolved
Hide resolved
src/pages/[platform]/build-a-backend/auth/connect-your-frontend/sign-up/index.mdx
Show resolved
Hide resolved
|
||
```ts | ||
const { nextStep } = await signIn({ | ||
username: state.username, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indentation is off here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, this info should be on the switching authentication flows page I believe.
src/pages/[platform]/build-a-backend/auth/connect-your-frontend/sign-in/index.mdx
Outdated
Show resolved
Hide resolved
authFlowType?: AuthFlowType; | ||
clientMetadata?: ClientMetadata; | ||
preferredChallenge?: AuthFactorType; | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might be confusing to have types here that aren't referenced in the examples; the connection between these types and how to pass as options is unclear. Is there a way we can clarify this? Maybe using the SignInInput
interface which is publicly exposed by the library... or just relying on the examples?
}, | ||
}); | ||
|
||
// nextStep.signInStep === 'DONE' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nextStep
may not be DONE in all cases. We should provide a partial implementation of the handleNextSignInStep()
handler
}); | ||
|
||
// nextStep.signInStep === 'CONTINUE_SIGN_IN_WITH_FIRST_FACTOR_SELECTION' | ||
handleNextSignInStep(nextStep); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should avoid including internal types in the documentation; we should show an example of how to use the availableChallenges instead.
src/pages/[platform]/build-a-backend/auth/connect-your-frontend/sign-in/index.mdx
Outdated
Show resolved
Hide resolved
src/pages/[platform]/build-a-backend/auth/connect-your-frontend/sign-in/index.mdx
Outdated
Show resolved
Hide resolved
src/pages/[platform]/build-a-backend/auth/connect-your-frontend/sign-in/index.mdx
Outdated
Show resolved
Hide resolved
src/pages/[platform]/build-a-backend/auth/connect-your-frontend/sign-in/index.mdx
Outdated
Show resolved
Hide resolved
src/pages/[platform]/build-a-backend/auth/manage-users/manage-webauthn-credentials/index.mdx
Outdated
Show resolved
Hide resolved
…d/sign-in/index.mdx Co-authored-by: James Jarvis <[email protected]>
…d/sign-in/index.mdx Co-authored-by: James Jarvis <[email protected]>
}); | ||
``` | ||
|
||
### Sign In with a Preferred Challenge for First Factor |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, be careful with headers, we created 3 new sections on this page. Should only be SMS OTP, Email OTP, WebAuthn Passkeys, and Password or SRP.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we restricted to those 3? I think giving details on the new USER_AUTH
flow is a necessary prerequisite to handle the new passwordless methods.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We want to be consistent with the other libraries. We'd provide conceptual introduction to the auth flow on the Switching Authentication Flows
page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good, I'll move it there - that section seems like a logical place for it to live in our doc structure (though I would still prefer it together 🙃)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A good compromise might be to add a <Callout />
mentioning USER_AUTH
with a link to that page
* 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]>
Description of changes:
Add js passwordless changes for all APIs.
Related GitHub issue #, if available:
Instructions
If this PR should not be merged upon approval for any reason, please submit as a DRAFT
Which product(s) are affected by this PR (if applicable)?
Which platform(s) are affected by this PR (if applicable)?
Please add the product(s)/platform(s) affected to the PR title
Checks
Does this PR conform to the styleguide?
Does this PR include filetypes other than markdown or images? Please add or update unit tests accordingly.
Are any files being deleted with this PR? If so, have the needed redirects been created?
Are all links in MDX files using the MDX link syntax rather than HTML link syntax?
ref: MDX:
[link](https://docs.amplify.aws/)
HTML:
<a href="https://docs.amplify.aws/">link</a>
When this PR is ready to merge, please check the box below
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.