Versions in this module Expand all Collapse all v0 v0.1.0 Aug 24, 2022 Changes in this version + var ErrCallbackUriNotMatchRedirectUri = errors.New("callback uri not match redirect uri") + var ErrCodeNotFoundInCallbackUri = errors.New("code not found in callback uri") + var ErrStateNotMatch = errors.New("state not match") + var ErrTokenAudienceNotMatch = errors.New("token audience not match") + var ErrTokenExpired = errors.New("token expired") + var ErrTokenIssuedInTheFuture = errors.New("token issued in the future") + var ErrTokenIssuedInThePast = errors.New("token issued in the past") + var ErrTokenIssuerNotMatch = errors.New("token issuer not match") + var ISSUED_AT_RESTRICTIONS int64 = 60 + func GenerateCodeChallenge(codeVerifier string) string + func GenerateCodeVerifier() string + func GenerateSignInUri(option *SignInUriGenerationOptions) (string, error) + func GenerateSignOutUri(option *SignOutUriGenerationOptions) (string, error) + func GenerateState() string + func Revoke(client *http.Client, options *RevocationOptions) error + func VerifyAndParseCodeFromCallbackUri(callbackUri, redirectUri, state string) (string, error) + func VerifyIdToken(idToken, clientId, issuer string, jwks *jose.JSONWebKeySet) error + type CodeTokenResponse struct + AccessToken string + ExpireIn int + IdToken string + RefreshToken string + Scope string + func FetchTokenByAuthorizationCode(client *http.Client, options *FetchTokenByAuthorizationCodeOptions) (CodeTokenResponse, error) + type FetchTokenByAuthorizationCodeOptions struct + ClientId string + Code string + CodeVerifier string + RedirectUri string + Resource string + TokenEndpoint string + type FetchTokenByRefreshTokenOptions struct + ClientId string + RefreshToken string + Resource string + Scopes []string + TokenEndpoint string + type IdTokenClaims struct + AtHash string + Aud string + Avatar string + Exp int64 + Iat int64 + Iss string + Name string + RoleNames []string + Sub string + Username string + func DecodeIdToken(token string) (IdTokenClaims, error) + type JwksResponse struct + Keys []map[string]string + func FetchJwks(client *http.Client, jwksUri string) (JwksResponse, error) + type OidcConfigResponse struct + AuthorizationEndpoint string + EndSessionEndpoint string + Issuer string + JwksUri string + RevocationEndpoint string + TokenEndpoint string + func FetchOidcConfig(client *http.Client, endpoint string) (OidcConfigResponse, error) + type RefreshTokenResponse = CodeTokenResponse + func FetchTokenByRefreshToken(client *http.Client, options *FetchTokenByRefreshTokenOptions) (RefreshTokenResponse, error) + type RevocationOptions struct + ClientId string + RevocationEndpoint string + Token string + type SignInUriGenerationOptions struct + AuthorizationEndpoint string + ClientId string + CodeChallenge string + Prompt string + RedirectUri string + Resources []string + Scopes []string + State string + type SignOutUriGenerationOptions struct + EndSessionEndpoint string + IdToken string + PostLogoutRedirectUri string v0.1.0-alpha.1 Aug 25, 2022 Other modules containing this package github.com/logto-io/go