Documentation
¶
Index ¶
- type CognitoAdapter
- func (a *CognitoAdapter) ClaimsFromCode(ctx context.Context, code string) (jwt.MapClaims, error)
- func (a *CognitoAdapter) ConfirmAccount(ctx context.Context, email string, code string) (bool, error)
- func (a *CognitoAdapter) DeleteUser(ctx context.Context, accessToken string) error
- func (a *CognitoAdapter) ForgotPassword(ctx context.Context, userName string) (*string, error)
- func (a *CognitoAdapter) GetUserByToken(ctx context.Context, token string) (*CognitoUser, error)
- func (a *CognitoAdapter) GetUsersByEmail(ctx context.Context, email string) ([]*CognitoUser, error)
- func (a *CognitoAdapter) OauthCodeUrl() string
- func (a *CognitoAdapter) ResendConfirmationCode(ctx context.Context, username string) error
- func (a *CognitoAdapter) ResetPassword(ctx context.Context, code string, userName string, password string) error
- func (a *CognitoAdapter) SignIn(ctx context.Context, email string, password string) (*types.AuthenticationResultType, error)
- func (a *CognitoAdapter) SignUp(ctx context.Context, firstName string, lastName string, email string, ...) (bool, error)
- func (a *CognitoAdapter) UpdateAttributes(ctx context.Context, username string, attributes []types.AttributeType) error
- func (a *CognitoAdapter) UpdatePassword(ctx context.Context, email string, password string) error
- type CognitoUser
- type OauthHandler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CognitoAdapter ¶ added in v0.3.0
type CognitoAdapter struct {
// contains filtered or unexported fields
}
func New ¶ added in v0.3.0
func New(cognitoConfig configs.Cognito, region string) (*CognitoAdapter, error)
New creates a new Cognito adapter with the provided configuration. This function handles all the complex setup internally, including creating the Cognito client and OAuth handler based on whether you're using a local or production environment.
func (*CognitoAdapter) ClaimsFromCode ¶ added in v0.3.0
func (*CognitoAdapter) ConfirmAccount ¶ added in v0.3.0
func (*CognitoAdapter) DeleteUser ¶ added in v0.3.0
func (a *CognitoAdapter) DeleteUser(ctx context.Context, accessToken string) error
func (*CognitoAdapter) ForgotPassword ¶ added in v0.3.0
func (*CognitoAdapter) GetUserByToken ¶ added in v0.3.0
func (a *CognitoAdapter) GetUserByToken(ctx context.Context, token string) (*CognitoUser, error)
func (*CognitoAdapter) GetUsersByEmail ¶ added in v0.3.0
func (a *CognitoAdapter) GetUsersByEmail(ctx context.Context, email string) ([]*CognitoUser, error)
func (*CognitoAdapter) OauthCodeUrl ¶ added in v0.3.0
func (a *CognitoAdapter) OauthCodeUrl() string
func (*CognitoAdapter) ResendConfirmationCode ¶ added in v0.3.0
func (a *CognitoAdapter) ResendConfirmationCode(ctx context.Context, username string) error
func (*CognitoAdapter) ResetPassword ¶ added in v0.3.0
func (*CognitoAdapter) SignIn ¶ added in v0.3.0
func (a *CognitoAdapter) SignIn(ctx context.Context, email string, password string) (*types.AuthenticationResultType, error)
func (*CognitoAdapter) UpdateAttributes ¶ added in v0.3.0
func (a *CognitoAdapter) UpdateAttributes(ctx context.Context, username string, attributes []types.AttributeType) error
func (*CognitoAdapter) UpdatePassword ¶ added in v0.3.0
type CognitoUser ¶ added in v0.3.0
type OauthHandler ¶
type OauthHandler struct {
// contains filtered or unexported fields
}
func NewCognitoOauthHandler ¶ added in v0.2.6
func NewCognitoOauthHandler(cognitoConfig configs.Cognito, scopes []string) (*OauthHandler, error)
NewCognitoOauthHandler is a wrapper on NewOauthHandler that uses the CognitoConfig for most of the variables.
func NewOauthHandler ¶
func NewOauthHandler(clientId string, clientSecret string, redirectUrl string, issuerUrl string, scopes []string) (*OauthHandler, error)
NewOauthHandler creates a handler that is meant to operate between oidc and oauth to handle the necessary redirects and issuer interactions. This has been tested against Cognito specifically.
func (*OauthHandler) AuthCodeUrl ¶
func (h *OauthHandler) AuthCodeUrl(state string, opts ...oauth2.AuthCodeOption) string
func (*OauthHandler) ExchangeCode ¶
func (*OauthHandler) Verifier ¶
func (h *OauthHandler) Verifier() *oidc.IDTokenVerifier