Versions in this module Expand all Collapse all v1 v1.1.0 Sep 1, 2020 Changes in this version + const AuthorisationCode + const ClientCredentials + const PKCE + const WellKnownPath + func AbsoluteExpiry(now time.Time, expiresIn int) int64 + func AssertAvailablePRNG() error + func BuildCodeAuthorisationRequest(configuration WellKnownConfiguration, clientId string, redirectUri string, ...) string + func FormPost(tokenEndpoint string, clientId string, clientSecret string, ...) error + func GenerateBase64Sha256Hash(input string) string + func GeneratePkceString(n int) (string, error) + func GenerateRandomBytes(n int) ([]byte, error) + func GenerateRandomStringURLSafe(n int) (string, error) + func GetRandomNumberBetween(min int, max int) (int, error) + func GetSchemeAndHost(urlString string) (string, error) + func ValidateToken(tokenString string, configuration WellKnownConfiguration, clientId string) (interface{}, error) + type AccessTokenResultSet struct + AccessToken string + ExpiresAt int64 + ExpiresIn int + TokenType string + func RequestWithClientCredentials(tokenEndpoint string, clientId string, clientSecret string, scope string) (AccessTokenResultSet, error) + type AuthorisationResponse struct + Code string + State string + func ValidateAuthorisationResponse(url *url.URL, state string) (AuthorisationResponse, error) + type CodeVerifier struct + CodeChallenge string + CodeVerifier string + func GenerateCodeVerifier() (CodeVerifier, error) + type RefreshResult struct + AccessToken string + ExpiresIn int + RefreshToken string + TokenType string + func RefreshToken(authority string, clientId string, clientSecret string, refreshToken string) (RefreshResult, error) + type TokenResultSet struct + AccessToken string + ExpiresAt int64 + ExpiresIn int + IdentityToken string + RefreshToken string + TokenType string + func ExchangeCodeForToken(tokenEndpoint string, code string, clientId string, clientSecret string, ...) (TokenResultSet, error) + type WellKnownConfiguration struct + AuthorisationEndpoint string + Issuer string + JwksUri string + TokenEndpoint string + func GetMetadata(authority string) (WellKnownConfiguration, error)