Documentation ¶
Overview ¶
Package onelogin provides a client for GOV.UK's One Login service.
Index ¶
- Variables
- type Client
- func (c *Client) AuthCodeURL(state, nonce, locale string, identity bool) (string, error)
- func (c *Client) CheckHealth(ctx context.Context) error
- func (c *Client) EndSessionURL(idToken, postLogoutURL string) (string, error)
- func (c *Client) Exchange(ctx context.Context, code, nonce string) (idToken, accessToken string, err error)
- func (c *Client) ParseIdentityClaim(ctx context.Context, u UserInfo) (identity.UserData, error)
- func (c *Client) UserInfo(ctx context.Context, idToken string) (UserInfo, error)
- type CoreIdentityClaims
- type Credential
- type CredentialBirthDate
- type CredentialName
- type CredentialSubject
- type Date
- type Doer
- type IdentityPublicKeyFunc
- type Logger
- type NamePart
- type ReturnCodeInfo
- type SecretsClient
- type UserInfo
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrConfigurationMissing = errors.New("openid configuration missing")
View Source
var ErrMissingCoreIdentityJWT = errors.New("UserInfo missing CoreIdentityJWT property")
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func New ¶ added in v0.890.0
func New(ctx context.Context, logger Logger, httpClient *http.Client, secretsClient SecretsClient, issuer, clientID, redirectURL string, identityPublicKeyFunc IdentityPublicKeyFunc) *Client
func (*Client) AuthCodeURL ¶
func (*Client) CheckHealth ¶ added in v0.892.0
func (*Client) EndSessionURL ¶
func (*Client) ParseIdentityClaim ¶
type CoreIdentityClaims ¶
type CoreIdentityClaims struct { jwt.RegisteredClaims Vot string `json:"vot"` Vtm string `json:"vtm"` Vc Credential `json:"vc"` }
type Credential ¶
type Credential struct { Type []string `json:"type"` CredentialSubject CredentialSubject `json:"credentialSubject"` }
type CredentialBirthDate ¶
type CredentialName ¶
type CredentialName struct { // ValidFrom shows when a name started to be used. If the zero value then the // user may have used that name from birth. ValidFrom Date `json:"validFrom"` // ValidUntil shows when the name ceased to be used. If the zero value then // this is the current name. ValidUntil Date `json:"validUntil"` // NameParts contains the components of the name in any order. The order of // names may depend on either your user’s preferences or the order they appear // on documents used to prove your user’s identity. NameParts []NamePart `json:"nameParts"` }
type CredentialSubject ¶
type CredentialSubject struct { Names []CredentialName `json:"name"` // BirthDate may list multiple values if there’s evidence an incorrect date of // birth was previously recorded for your user. The date of birth GOV.UK One // Login has highest confidence in will be the first item in the list. BirthDate []CredentialBirthDate `json:"birthDate"` }
func (CredentialSubject) CurrentNameParts ¶
func (s CredentialSubject) CurrentNameParts() []NamePart
type Date ¶
func (*Date) UnmarshalText ¶
type IdentityPublicKeyFunc ¶ added in v0.876.0
type ReturnCodeInfo ¶ added in v0.1259.0
type ReturnCodeInfo struct {
Code string `json:"code"`
}
type SecretsClient ¶
type UserInfo ¶
type UserInfo struct { Sub string `json:"sub"` Email string `json:"email"` EmailVerified bool `json:"email_verified"` Phone string `json:"phone"` PhoneVerified bool `json:"phone_verified"` UpdatedAt int `json:"updated_at"` CoreIdentityJWT string `json:"https://vocab.account.gov.uk/v1/coreIdentityJWT"` ReturnCodes []ReturnCodeInfo `json:"https://vocab.account.gov.uk/v1/returnCode,omitempty"` Addresses []credentialAddress `json:"https://vocab.account.gov.uk/v1/address,omitempty"` }
Click to show internal directories.
Click to hide internal directories.