Options
All
  • Public
  • Public/Protected
  • All
Menu

External module "spec/methods/auth/auth"

Index

Modules

BeginPassReset

BeginPassReset:

Initiate a password reset. This call will trigger an email containing the passwordResetCode which must be provided to confirm the reset.

Args

Args:

username

username: string

Response

Response: MessageResponse

Result

When successful, the message ought to say something like, "An email has been sent with a temporary password."

Const HTTP

HTTP: POST = "POST"

Const Path

Path: string = `${authBasePath}/${ResourcePaths.passReset}`

isArgs

  • isArgs(val: any): boolean

newArgs

BeginSetupAppMfa

BeginSetupAppMfa:

Begin Setup for App MFA

Args

Args:

refreshToken

refreshToken: string

Response

Response: ApiResponse<Result>

Result

Result: object

Returns secret code to enter into the MFA App.

Type declaration

  • secretCode: string

Const HTTP

HTTP: POST = "POST"

Const Path

Path: string = `${authBasePath}/${ResourcePaths.configureMfa}`

isArgs

  • isArgs(val: any): boolean

newArgs

ConfirmPassReset

ConfirmPassReset:

Conclude a password reset by supplying the code from the email along with a new password.

Args

Args:

newPassword

newPassword: string

passwordResetCode

passwordResetCode: string

username

username: string

Response

Response: MessageResponse

Result

Ought to tell them they can now log in with their new password.

Const HTTP

HTTP: POST = "POST"

Const Path

Path: string = `${authBasePath}/${ResourcePaths.passReset}`

isArgs

  • isArgs(val: any): boolean

newArgs

ConfirmSetupAppMfa

ConfirmSetupAppMfa:

Confirm Setup for App MFA

Args

Args:

mfaVerifyCode

mfaVerifyCode: string

refreshToken

refreshToken: string

Response

Response: MessageResponse

Result

When successful, the message ought to say something like, "Your MFA app has been successfully configured."

Const HTTP

HTTP: POST = "POST"

Const Path

Path: string = `${authBasePath}/${ResourcePaths.configureMfa}`

isArgs

  • isArgs(val: any): boolean

newArgs

Login

Login:

Main login call which either produces a user object and credentials, or returns a challenge.

Args

Args:

password

password: string

username

username: string

Response

Result

Const HTTP

HTTP: POST = "POST"

Const Path

Path: string = `${authBasePath}/${ResourcePaths.login}`

isArgs

  • isArgs(val: any): boolean

newArgs

MfaLoginChallenge

MfaLoginChallenge:

Corresponds to the challenge a user with MFA enabled gets to verify their MFA code.

Args

Args:

Note that the session here would be from a previous ChallengeResponse. This is not the Authorization token, these values are passed back and forth in each step of a Challenge Response interaction.

mfaLoginCode

mfaLoginCode: string

session

session: string

username

username: string

Response

Result

Const HTTP

HTTP: POST = "POST"

Const Path

Path: string = `${authBasePath}/${ResourcePaths.login}`

isArgs

  • isArgs(val: any): boolean

newArgs

NewPassChallenge

NewPassChallenge:

Corresponds to the initial challenge a user receives after making their account so they can create a new one.

Args

Args:

Note that the session here would be from a previous ChallengeResponse. This is not the Authorization token, these values are passed back and forth in each step of a Challenge Response interaction.

newPassword

newPassword: string

session

session: string

username

username: string

Response

Result

Const HTTP

HTTP: POST = "POST"

Const Path

Path: string = `${authBasePath}/${ResourcePaths.login}`

isArgs

  • isArgs(val: any): boolean

newArgs

Refresh

Refresh:

Refresh login call which only requires a token and ought to produce fresh credentials, unless it has been more than a month.

Args

Args:

refreshToken

refreshToken: string

Response

Result

Const HTTP

HTTP: POST = "POST"

Const Path

Path: string = `${authBasePath}/${ResourcePaths.login}`

isArgs

  • isArgs(val: any): boolean

newArgs

SelectMfaChallenge

SelectMfaChallenge:

Corresponds to the challenge a user with MFA enabled gets to verify their MFA code.

Args

Args:

Note that the session here would be from a previous ChallengeResponse. This is not the Authorization token, these values are passed back and forth in each step of a Challenge Response interaction.

mfaSelection

mfaSelection: MfaTypes

session

session: string

username

username: string

Response

Result

Const HTTP

HTTP: POST = "POST"

Const Path

Path: string = `${authBasePath}/${ResourcePaths.login}`

isArgs

  • isArgs(val: any): boolean

newArgs

SetMfaPreference

SetMfaPreference:

Sets user MFA preferences

Args

Args:

mfaEnabled

mfaEnabled: boolean

Optional preferredMfa

preferredMfa: MfaTypes

Response

Response: ApiResponse<Result>

Result

Result: object

Returns which MFA method (if any) is enabled

Type declaration

Const HTTP

HTTP: POST = "POST"

Const Path

Path: string = `${authBasePath}/${ResourcePaths.configureMfa}`

isArgs

  • isArgs(val: any): boolean

newArgs

SetupSmsMfa

SetupSmsMfa:

Setup Phone Number for SMS MFA

Args

Args:

phoneNumber

phoneNumber: string

Phone numbers must follow these formatting rules: A phone number must start with a plus (+) sign, followed immediately by the country code. A phone number can only contain the + sign and digits. You must remove any other characters from a phone number, such as parentheses, spaces, or dashes (-) before submitting the value to the service. For example, a United States-based phone number must follow this format: +14325551212. (Sourced from: https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-settings-attributes.html)

Response

Response: MessageResponse

Result

When successful, the message ought to say something like, "Your phone number has been registered for SMS MFA."

Const HTTP

HTTP: POST = "POST"

Const Path

Path: string = `${authBasePath}/${ResourcePaths.configureMfa}`

isArgs

  • isArgs(val: any): boolean

newArgs

Enumerations

ResourcePaths

ResourcePaths:

Subpaths available on the auth endpoint. Built into an enum for easy change later on.

configureMfa

configureMfa: = "configure-mfa"

login

login: = "login"

passReset

passReset: = "password-reset"

Type aliases

UserOrChallengeResponse

UserOrChallengeResponse: ApiResponse<UserOrChallengeResult>

Decoded API response from a call to our login endpoint. It either contains successful authentication ora challenge for the user to respond to.

UserOrChallengeResult

UserOrChallengeResult: XOR<AuthData, Data>

Response from a call to our login endpoint. It either contains successful authentication or a challenge for the user to respond to.

Variables

Const authBasePath

authBasePath: string = `${apiBasePath}/${RootResources.auth}`

Baseline path from which more specific auth paths are built on top of.

Generated using TypeDoc