Documentation
¶
Index ¶
- Variables
- func CallDeviceAccessTokenEndpoint(ctx context.Context, request *DeviceAccessTokenRequest, ...) (*oidc.AccessTokenResponse, error)deprecated
- func CallDeviceAccessTokenEndpointWithAuthFn(ctx context.Context, request *DeviceAccessTokenRequest, ...) (*oidc.AccessTokenResponse, error)
- func CallDeviceAuthorizationEndpoint(ctx context.Context, request *oidc.ClientCredentialsRequest, ...) (*oidc.DeviceAuthorizationResponse, error)
- func CallEndSessionEndpoint(ctx context.Context, request any, authFn any, caller EndSessionCaller) (*url.URL, error)
- func CallRevokeEndpoint(ctx context.Context, request any, authFn any, caller RevokeCaller) error
- func CallTokenEndpoint(ctx context.Context, request any, caller TokenEndpointCaller) (newToken *oauth2.Token, err error)
- func CallTokenEndpointWithAuthFn(ctx context.Context, request any, authFn any, caller TokenEndpointCaller) (newToken *oauth2.Token, err error)
- func CallTokenExchangeEndpoint(ctx context.Context, request any, authFn any, caller TokenEndpointCaller) (resp *oidc.TokenExchangeResponse, err error)
- func ClientAssertionCodeOptions(assertion string) []oauth2.AuthCodeOption
- func ClientAssertionFormAuthorization(assertion string) http.FormAuthorization
- func Discover(ctx context.Context, issuer string, httpClient *http.Client, ...) (*oidc.DiscoveryConfiguration, error)
- func JWTProfileExchange(ctx context.Context, jwtProfileGrantRequest *oidc.JWTProfileGrantRequest, ...) (*oauth2.Token, error)
- func NewSignerFromPrivateKeyByte(key []byte, keyID string) (jose.Signer, error)
- func PollDeviceAccessTokenEndpoint(ctx context.Context, interval time.Duration, request *DeviceAccessTokenRequest, ...) (*oidc.AccessTokenResponse, error)deprecated
- func PollDeviceAccessTokenEndpointWithAuthFn(ctx context.Context, interval time.Duration, request *DeviceAccessTokenRequest, ...) (*oidc.AccessTokenResponse, error)
- func SignedJWTProfileAssertion(clientID string, audience []string, expiration time.Duration, ...) (string, error)
- type ClientSecretBasicAuthRequestdeprecated
- type DeviceAccessTokenRequest
- type DeviceAuthorizationCaller
- type EndSessionCaller
- type KeyFiledeprecated
- type RevokeCaller
- type RevokeRequest
- type TokenEndpointCaller
Constants ¶
This section is empty.
Variables ¶
var ( Encoder = httphelper.Encoder(oidc.NewEncoder()) Tracer = otel.Tracer("github.com/zitadel/oidc/pkg/client") )
var ErrEndpointNotSet = errors.New("endpoint not set")
Functions ¶
func CallDeviceAccessTokenEndpoint
deprecated
func CallDeviceAccessTokenEndpoint(ctx context.Context, request *DeviceAccessTokenRequest, caller TokenEndpointCaller) (*oidc.AccessTokenResponse, error)
Deprecated: Use CallDeviceAccessTokenEndpointWithAuthFn instead.
func CallDeviceAccessTokenEndpointWithAuthFn ¶ added in v3.47.9
func CallDeviceAccessTokenEndpointWithAuthFn(ctx context.Context, request *DeviceAccessTokenRequest, caller TokenEndpointCaller, authFn any) (*oidc.AccessTokenResponse, error)
CallDeviceAccessTokenEndpointWithAuthFn calls the device access token endpoint, accepting an authFn for custom authentication.
func CallDeviceAuthorizationEndpoint ¶
func CallDeviceAuthorizationEndpoint(ctx context.Context, request *oidc.ClientCredentialsRequest, caller DeviceAuthorizationCaller, authFn any) (*oidc.DeviceAuthorizationResponse, error)
func CallEndSessionEndpoint ¶
func CallRevokeEndpoint ¶
func CallTokenEndpoint ¶
func CallTokenEndpointWithAuthFn ¶ added in v3.47.9
func CallTokenExchangeEndpoint ¶
func CallTokenExchangeEndpoint(ctx context.Context, request any, authFn any, caller TokenEndpointCaller) (resp *oidc.TokenExchangeResponse, err error)
func ClientAssertionCodeOptions ¶
func ClientAssertionCodeOptions(assertion string) []oauth2.AuthCodeOption
func ClientAssertionFormAuthorization ¶
func ClientAssertionFormAuthorization(assertion string) http.FormAuthorization
func Discover ¶
func Discover(ctx context.Context, issuer string, httpClient *http.Client, wellKnownUrl ...string) (*oidc.DiscoveryConfiguration, error)
Discover calls the discovery endpoint of the provided issuer and returns its configuration It accepts an optional argument "wellknownUrl" which can be used to override the discovery endpoint url
func JWTProfileExchange ¶
func JWTProfileExchange(ctx context.Context, jwtProfileGrantRequest *oidc.JWTProfileGrantRequest, caller TokenEndpointCaller) (*oauth2.Token, error)
JWTProfileExchange handles the oauth2 jwt profile exchange
func PollDeviceAccessTokenEndpoint
deprecated
func PollDeviceAccessTokenEndpoint(ctx context.Context, interval time.Duration, request *DeviceAccessTokenRequest, caller TokenEndpointCaller) (*oidc.AccessTokenResponse, error)
Deprecated: Use PollDeviceAccessTokenEndpointWithAuthFn instead.
func PollDeviceAccessTokenEndpointWithAuthFn ¶ added in v3.47.9
func PollDeviceAccessTokenEndpointWithAuthFn(ctx context.Context, interval time.Duration, request *DeviceAccessTokenRequest, caller TokenEndpointCaller, authFn any) (*oidc.AccessTokenResponse, error)
PollDeviceAccessTokenEndpointWithAuthFn polls the device access token endpoint, accepting an authFn for custom authentication.
Types ¶
type ClientSecretBasicAuthRequest
deprecated
added in
v3.45.5
Deprecated: This interface function Auth() is no longer invoked because it violates RFC 6749 §2.3: The client MUST NOT use more than one authentication method in each request.
Configure the OAuth2 endpoint AuthStyle (e.g., oauth2.AuthStyleInHeader) or use the "authFn" parameter in the related functions for custom needs.
type DeviceAccessTokenRequest ¶
type DeviceAccessTokenRequest struct {
*oidc.ClientCredentialsRequest
oidc.DeviceAccessTokenRequest
}
func (*DeviceAccessTokenRequest) Auth
deprecated
added in
v3.45.5
func (r *DeviceAccessTokenRequest) Auth(req *http.Request)
Deprecated: This function is no longer invoked because it violates RFC 6749 §2.3: The client MUST NOT use more than one authentication method in each request.
Configure the OAuth2 endpoint AuthStyle (e.g., oauth2.AuthStyleInHeader) or use the "authFn" parameter in the related functions for custom needs.
type EndSessionCaller ¶
type KeyFile
deprecated
type KeyFile struct {
Type string `json:"type"` // serviceaccount or application
KeyID string `json:"keyId"`
Key string `json:"key"`
Issuer string `json:"issuer"` // not yet in file
// serviceaccount
UserID string `json:"userId"`
// application
ClientID string `json:"clientId"`
}
Deprecated: use github.com/zitadel/zitadel-go/v3/pkg/client.KeyFile instead. The type will be removed in the next major release.
func ConfigFromKeyFile
deprecated
Deprecated: use github.com/zitadel/zitadel-go/v3/pkg/client.ConfigFromKeyFile instead. The type will be removed in the next major release.
func ConfigFromKeyFileData
deprecated
Deprecated: use github.com/zitadel/zitadel-go/v3/pkg/client.ConfigFromKeyFileData instead. The type will be removed in the next major release.
type RevokeCaller ¶
type RevokeRequest ¶
type RevokeRequest struct {
Token string `schema:"token"`
TokenTypeHint string `schema:"token_type_hint"`
ClientID string `schema:"client_id"`
ClientSecret string `schema:"client_secret"`
}
func (RevokeRequest) Auth
deprecated
added in
v3.45.5
func (r RevokeRequest) Auth(req *http.Request)
Deprecated: This function is no longer invoked because it violates RFC 6749 §2.3: The client MUST NOT use more than one authentication method in each request.
Configure the OAuth2 endpoint AuthStyle (e.g., oauth2.AuthStyleInHeader) or use the "authFn" parameter in the related functions for custom needs.