Documentation
¶
Overview ¶
Package passwordless provides types for the Auth0 passwordless authentication endpoints.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChallengeResponse ¶
type ChallengeResponse struct {
// An opaque session identifier to be passed to `LoginWithOTPChallenge`. Callers must not parse or depend on its contents.
AuthSession string `json:"auth_session,omitempty"`
}
ChallengeResponse defines the response from the `ChallengeWithEmail` and `ChallengeWithPhoneNumber` requests.
type ChallengeWithEmailRequest ¶
type ChallengeWithEmailRequest struct {
oauth.ClientAuthentication
// The name of the database connection. Required.
Connection string `json:"connection,omitempty"`
// The user's email address. Required.
Email string `json:"email,omitempty"`
// Whether a new user should be created if one does not already exist. Always sent, defaults to false.
AllowSignup bool `json:"allow_signup"`
}
ChallengeWithEmailRequest defines the request body for starting a passwordless OTP flow on a database connection using an email address.
type ChallengeWithPhoneNumberRequest ¶
type ChallengeWithPhoneNumberRequest struct {
oauth.ClientAuthentication
// The name of the database connection. Required.
Connection string `json:"connection,omitempty"`
// The user's phone number in E.164 format (e.g. +14155550100). Required.
PhoneNumber string `json:"phone_number,omitempty"`
// How the code is delivered, either `text` or `voice`. If omitted, the server defaults to `text`.
DeliveryMethod string `json:"delivery_method,omitempty"`
// Whether a new user should be created if one does not already exist. Always sent, defaults to false.
AllowSignup bool `json:"allow_signup"`
}
ChallengeWithPhoneNumberRequest defines the request body for starting a passwordless OTP flow on a database connection using a phone number.
type LoginWithEmailRequest ¶
type LoginWithEmailRequest struct {
oauth.ClientAuthentication
// API Identifier of the API for which you want to get an access token.
Audience string `json:"audience,omitempty"`
// The user's verification code.
Code string `json:"otp,omitempty"`
// The user's email address.
Email string `json:"username,omitempty"`
GrantType string `json:"grant_type,omitempty"`
Realm string `json:"realm,omitempty"`
// Use `openid` to get an ID token, or `openid profile email` to also include user profile information in the ID token.
Scope string `json:"scope,omitempty"`
}
LoginWithEmailRequest defines the request body for exchanging a code requested by `SendEmail` for a token.
type LoginWithOTPChallengeRequest ¶
type LoginWithOTPChallengeRequest struct {
oauth.ClientAuthentication
// The auth session returned by the challenge request. Required.
AuthSession string
// The one-time code the user received. Required.
OTP string
// Use `openid` to get an ID token, or `openid profile email` to also include user profile information in the ID token.
Scope string
// API Identifier of the API for which you want to get an access token.
Audience string
// Extra parameters to be merged into the request body. Values set here will override any existing values.
ExtraParameters map[string]string
}
LoginWithOTPChallengeRequest defines the request body for exchanging a code and the auth session returned by `ChallengeWithEmail` or `ChallengeWithPhoneNumber` for a token.
type LoginWithSMSRequest ¶
type LoginWithSMSRequest struct {
oauth.ClientAuthentication
// API Identifier of the API for which you want to get an access token.
Audience string `json:"audience,omitempty"`
// The user's verification code.
Code string `json:"otp,omitempty"`
// The user's phone number.
PhoneNumber string `json:"username,omitempty"`
GrantType string `json:"grant_type,omitempty"`
Realm string `json:"realm,omitempty"`
// Use `openid` to get an ID token, or `openid profile email` to also include user profile information in the ID token.
Scope string `json:"scope,omitempty"`
}
LoginWithSMSRequest defines the request body for exchanging a code requested by `SendSMS` for a token.
type SendEmailRequest ¶
type SendEmailRequest struct {
oauth.ClientAuthentication
Connection string `json:"connection,omitempty"`
// The users's email address.
Email string `json:"email,omitempty"`
// Use `link` to send a link or `code` to send a verification code. If omitted, a `link` will be sent.
Send string `json:"send,omitempty"`
// Append or override the link parameters (like `scope`, `redirect_uri`, `protocol`, `response_type`), when you send a link.
AuthParams map[string]interface{} `json:"authParams,omitempty"`
}
SendEmailRequest defines the request body for starting a passwordless flow via email.
type SendEmailResponse ¶
type SendEmailResponse struct {
// The identifier of the request.
ID string `json:"_id,omitempty"`
// The user's email address.
Email string `json:"email,omitempty"`
// Whether the user's email address is verified.
EmailVerified bool `json:"email_verified,omitempty"`
}
SendEmailResponse defines the response from the `SendEmail` request.
type SendSMSRequest ¶
type SendSMSRequest struct {
oauth.ClientAuthentication
Connection string `json:"connection,omitempty"`
// The user's phone number.
PhoneNumber string `json:"phone_number,omitempty"`
// Append or override the link parameters (like `scope`, `redirect_uri`, `protocol`, `response_type`), when you send a link.
AuthParams map[string]interface{} `json:"authParams,omitempty"`
}
SendSMSRequest defines the request body for starting a passwordless flow via email.
type SendSMSResponse ¶
type SendSMSResponse struct {
// The identifier of the request.
ID string `json:"_id,omitempty"`
// The user's phone number.
PhoneNumber string `json:"phone_number,omitempty"`
// Whether the users phone number is verified.
PhoneVerified bool `json:"phone_verified,omitempty"`
}
SendSMSResponse defines the response from the `SendSMS` request.