Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthCodeOpts ¶
type AuthResult ¶
AuthResult represents an output DTO of the Authentication use-case.
type AuthenticateOpts ¶
type BrowserOpts ¶
type ClientCredentialsOpts ¶
type ClientCredentialsOpts struct{}
type DeviceOpts ¶
type DeviceOpts struct {
Browser *BrowserOpts
}
type GrantOpts ¶
type GrantOpts struct {
AuthCodeOpts *AuthCodeOpts
PasswordOpts *PasswordOpts
DeviceOpts *DeviceOpts
ClientCredentialsOpts *ClientCredentialsOpts
}
type PasswordOpts ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func (*Service) Authenticate ¶
func (s *Service) Authenticate(ctx context.Context, opts AuthenticateOpts) (*AuthResult, error)
Authenticate provides the internal use-case of authentication.
If the IDToken is not set, it performs the authentication flow. If the IDToken is valid, it does nothing. If the IDtoken has expired and the RefreshToken is set, it refreshes the token. If the RefreshToken has expired, it performs the authentication flow.
The authentication flow is determined as:
If the Username is not set, it performs the authorization code flow. Otherwise, it performs the resource owner password credentials flow. If the Password is not set, it asks a password by the prompt.