apple

package
v2.38.2-0...-94d1eb7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 19, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Provider

type Provider struct {
	*oidc.Provider
}

Provider is the idp.Provider implementation for Apple

func New

func New(clientID, teamID, keyID, callbackURL string, key []byte, scopes []string, options ...oidc.ProviderOpts) (*Provider, error)

type Session

type Session struct {
	*oidc.Session
	UserFormValue string
}

Session extends the oidc.Session with the formValues returned from the callback. This enables to parse the user (name and email), which Apple only returns as form params on registration

func (*Session) FetchUser

func (s *Session) FetchUser(ctx context.Context) (user idp.User, err error)

FetchUser implements the idp.Session interface. It will execute an OIDC code exchange if needed to retrieve the tokens, extract the information from the id_token and if available also from the `user` form value. The information will be mapped into an idp.User.

type User

type User struct {
	*oidc.User
}

User extends the oidc.User by returning the email as preferred_username, since Apple does not return the latter.

func NewUser

func NewUser(info *openid.UserInfo, names userNamesFormValue) *User

func (*User) GetPreferredUsername

func (u *User) GetPreferredUsername() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL