Package clients
import "github.com/ory/fosite/integration/clients"
- Overview
- Index
type Header struct {
Algorithm string `json:"alg"`
Typ string `json:"typ"`
KeyID string `json:"kid,omitempty"`
}
type Introspect struct {
}
func NewIntrospectClient(endpointURL string) *Introspect
func (c *Introspect) IntrospectToken(
ctx context.Context,
form IntrospectForm,
header map[string]string,
) (*IntrospectResponse, error)
type IntrospectForm struct {
Token string
Scopes []string
}
type IntrospectResponse struct {
Active bool `json:"active"`
ClientID string `json:"client_id,omitempty"`
Scope string `json:"scope,omitempty"`
Audience []string `json:"aud,omitempty"`
ExpiresAt int64 `json:"exp,omitempty"`
IssuedAt int64 `json:"iat,omitempty"`
Subject string `json:"sub,omitempty"`
Username string `json:"username,omitempty"`
}
type JWTBearer struct {
Signer jose.Signer
}
func NewJWTBearer(tokenURL string) *JWTBearer
func (*JWTBearer) GetToken
¶
func (c *JWTBearer) GetToken(ctx context.Context, payloadData *JWTBearerPayload, scope []string) (*Token, error)
func (c *JWTBearer) SetPrivateKey(keyID string, privateKey *rsa.PrivateKey) error
type JWTBearerPayload struct {
*jwt.Claims
PrivateClaims map[string]interface{}
}
type RequestError struct {
Response *http.Response
Body []byte
}
func (*RequestError) Error
¶
func (r *RequestError) Error() string
type Token struct {
AccessToken string `json:"access_token"`
TokenType string `json:"token_type,omitempty"`
RefreshToken string `json:"refresh_token,omitempty"`
ExpiresIn int64 `json:"expires_in,omitempty"`
}