Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HandleIntrospect ¶
func HandleIntrospect(w http.ResponseWriter, r *http.Request)
HandleIntrospect godoc @Summary Introspect a token @Description Validates and retrieves metadata about a token @Tags introspect @Accept json @Produce json @Param token body IntrospectRequest true "Token introspection payload" @Success 200 {object} IntrospectResponse @Failure 400 {object} model.ApiError @Failure 401 {object} model.ApiError @Failure 429 {object} model.ApiError @Failure 500 {object} model.ApiError @Router /oauth2/introspect [post]
func ValidateTokenIntrospectRequest ¶
func ValidateTokenIntrospectRequest(input IntrospectRequest) error
Types ¶
type IntrospectRequest ¶
type IntrospectRequest struct {
Token string `json:"token"`
}
type IntrospectResponse ¶
type IntrospectResponse struct {
Active bool `json:"active"` // Whether the token is valid (true or false).
Scope string `json:"scope,omitempty"` // Space-delimited list of scopes associated with the token.
ClientID string `json:"client_id,omitempty"` // Client ID for which the token was issued.
Username string `json:"username,omitempty"` // The username of the authenticated user.
TokenType string `json:"token_type,omitempty"` // The type of the token (usually "bearer").
Exp int64 `json:"exp,omitempty"` // Expiration time (Unix timestamp).
Iat int64 `json:"iat,omitempty"` // Issued-at time (Unix timestamp).
Sub string `json:"sub,omitempty"` // The subject of the token (typically the user ID).
Aud string `json:"aud,omitempty"` // Intended audience for the token (e.g., the API).
Nbf int64 `json:"nbf,omitempty"` // Not-before time (Unix timestamp).
Jti string `json:"jti,omitempty"` // Unique identifier for the token.
Error string `json:"error,omitempty"`
ErrorDescription string `json:"error_description,omitempty"`
}
Click to show internal directories.
Click to hide internal directories.