-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into login-options
- Loading branch information
Showing
5 changed files
with
54 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -293,3 +293,49 @@ code the app produces. | |
```swift | ||
let authResponse = try await Descope.totp.verify(loginId: "[email protected]", code: "987654") | ||
``` | ||
|
||
### Password Authentication | ||
|
||
Authenticate users using a password. | ||
|
||
#### Sign Up with Password | ||
|
||
To create a new user that can later sign in with a password: | ||
|
||
```swift | ||
let authResponse = try await Descope.password.signUp(loginId: "[email protected]", password: "securePassword123!", details: SignUpDetails( | ||
name: "Andy Rhoads" | ||
)) | ||
``` | ||
|
||
#### Sign In with Password | ||
|
||
Authenticate an existing user using a password: | ||
|
||
```swift | ||
let authResponse = try await Descope.password.signIn(loginId: "[email protected]", password: "securePassword123!") | ||
``` | ||
|
||
#### Update Password | ||
|
||
If you need to update a user's password: | ||
|
||
```swift | ||
try await Descope.password.update(loginId: "[email protected]", newPassword: "newSecurePassword456!", refreshJwt: "user-refresh-jwt") | ||
``` | ||
|
||
#### Replace Password | ||
|
||
To replace a user's password by providing their current password: | ||
|
||
```swift | ||
let authResponse = try await Descope.password.replace(loginId: "[email protected]", oldPassword: "SecurePassword123!", newPassword: "NewSecurePassword456!") | ||
``` | ||
|
||
#### Send Password Reset Email | ||
|
||
Initiate a password reset by sending an email: | ||
|
||
```swift | ||
try await Descope.password.sendReset(loginId: "[email protected]", redirectURL: "exampleauthschema://my-app.com/handle-reset") | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters