...

Package clients

import "github.com/ory/fosite/integration/clients"
Overview
Index

Overview ▾

type Header struct {
    Algorithm string `json:"alg"`
    Typ       string `json:"typ"`
    KeyID     string `json:"kid,omitempty"`
}

type Introspect

type Introspect struct {
    // contains filtered or unexported fields
}

func NewIntrospectClient

func NewIntrospectClient(endpointURL string) *Introspect

func (*Introspect) IntrospectToken

func (c *Introspect) IntrospectToken(
    ctx context.Context,
    form IntrospectForm,
    header map[string]string,
) (*IntrospectResponse, error)

type IntrospectForm

type IntrospectForm struct {
    Token  string
    Scopes []string
}

type IntrospectResponse

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

type JWTBearer struct {
    Signer jose.Signer
    // contains filtered or unexported fields
}

func NewJWTBearer

func NewJWTBearer(tokenURL string) *JWTBearer

func (*JWTBearer) GetToken

func (c *JWTBearer) GetToken(ctx context.Context, payloadData *JWTBearerPayload, scope []string) (*Token, error)

func (*JWTBearer) SetPrivateKey

func (c *JWTBearer) SetPrivateKey(keyID string, privateKey *rsa.PrivateKey) error

type JWTBearerPayload

type JWTBearerPayload struct {
    *jwt.Claims

    PrivateClaims map[string]interface{}
}

type RequestError

type RequestError struct {
    Response *http.Response
    Body     []byte
}

func (*RequestError) Error

func (r *RequestError) Error() string

type Token

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"`
}