Documentation
¶
Overview ¶
Package apple implements OpenID Connect for apple
Index ¶
- Constants
- type Provider
- func (p *Provider) Authenticate(ctx context.Context, code string, v identity.State) (*oauth2.Token, error)
- func (p *Provider) Name() string
- func (p *Provider) Refresh(ctx context.Context, t *oauth2.Token, v identity.State) (*oauth2.Token, error)
- func (p *Provider) Revoke(ctx context.Context, t *oauth2.Token) error
- func (p *Provider) SignIn(w http.ResponseWriter, r *http.Request, state string) error
- func (p *Provider) SignOut(_ http.ResponseWriter, _ *http.Request, _, _, _ string) error
- func (p *Provider) UpdateUserInfo(_ context.Context, t *oauth2.Token, v any) error
Constants ¶
const Name = "apple"
Name identifies the apple identity provider.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Provider ¶
type Provider struct {
// contains filtered or unexported fields
}
Provider is an Apple implementation of the Authenticator interface.
func (*Provider) Authenticate ¶
func (p *Provider) Authenticate(ctx context.Context, code string, v identity.State) (*oauth2.Token, error)
Authenticate converts an authorization code returned from the identity provider into a token which is then converted into a user session.
func (*Provider) Refresh ¶
func (p *Provider) Refresh(ctx context.Context, t *oauth2.Token, v identity.State) (*oauth2.Token, error)
Refresh renews a user's session.
func (*Provider) Revoke ¶
Revoke method will remove all the Apple grants the user gave pomerium application during authorization.
func (*Provider) SignIn ¶
SignIn redirects to the url of the provider's OAuth 2.0 consent page that asks for permissions for the required scopes explicitly.
State is a token to protect the user from CSRF attacks. You must always provide a non-empty string and validate that it matches the the state query parameter on your redirect callback. See http://tools.ietf.org/html/rfc6749#section-10.12 for more info.