Documentation
¶
Overview ¶
This package provides a function which authenticates a user against Cognito and returns the AWS config and IDP tokens.
Index ¶
- type AuthOption
- func WithCognitoIdentityProviderClient(cipsvc CognitoIdentityProviderClient) AuthOption
- func WithCognitoSRP(csrp CognitoSRP) AuthOption
- func WithLogger(logger logging.Logger) AuthOption
- func WithRegion(region string) AuthOption
- func WithUserPool(userPoolID string, userPoolWebClientID string) AuthOption
- func WithUsernamePassword(username, password string) AuthOption
- type AuthResult
- type CognitoConfig
- type CognitoIdentityProviderClient
- type CognitoSRP
- type IDPTokens
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthOption ¶
type AuthOption func(*CognitoConfig)
AuthCognitoOption configures the AuthCognito function.
func WithCognitoIdentityProviderClient ¶
func WithCognitoIdentityProviderClient(cipsvc CognitoIdentityProviderClient) AuthOption
WithCognitoIdentityProviderClient sets the CognitoIdentityProvider client.
func WithCognitoSRP ¶
func WithCognitoSRP(csrp CognitoSRP) AuthOption
func WithLogger ¶
func WithLogger(logger logging.Logger) AuthOption
func WithUserPool ¶
func WithUserPool(userPoolID string, userPoolWebClientID string) AuthOption
WithUserPoolID sets the Cognito user pool ID and the Cognito user pool web client ID.
func WithUsernamePassword ¶
func WithUsernamePassword(username, password string) AuthOption
WithUsername sets the username and password.
type AuthResult ¶
AuthCognitoResult auth config results.
func Auth ¶
func Auth(ctx context.Context, opts ...AuthOption) (*AuthResult, error)
type CognitoConfig ¶
type CognitoConfig struct {
// contains filtered or unexported fields
}
type CognitoIdentityProviderClient ¶
type CognitoIdentityProviderClient interface { InitiateAuth(ctx context.Context, params *cognitoidentityprovider.InitiateAuthInput, optFns ...func(*cognitoidentityprovider.Options)) (*cognitoidentityprovider.InitiateAuthOutput, error) RespondToAuthChallenge(ctx context.Context, params *cognitoidentityprovider.RespondToAuthChallengeInput, optFns ...func(*cognitoidentityprovider.Options)) (*cognitoidentityprovider.RespondToAuthChallengeOutput, error) }
type CognitoSRP ¶
type IDPTokens ¶
type IDPTokens struct { // The access token. AccessToken *string // The expiration period of the authentication result in seconds. ExpiresIn int32 // The ID token. IdToken *string // The refresh token. RefreshToken *string // The token type. TokenType *string }
IDPTokens contains the cognito "oidc" tokens.
Click to show internal directories.
Click to hide internal directories.