Documentation
¶
Index ¶
- Constants
- 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
- type AuthorisationResponse
- type CodeVerifier
- type RefreshResult
- type TokenResultSet
- type WellKnownConfiguration
Constants ¶
View Source
const AuthorisationCode = "authorization_code"
View Source
const ClientCredentials = "client_credentials"
View Source
const PKCE = "PKCE"
View Source
const WellKnownPath = "/.well-known/openid-configuration"
Variables ¶
This section is empty.
Functions ¶
func AssertAvailablePRNG ¶
func AssertAvailablePRNG() error
func GeneratePkceString ¶
func GenerateRandomBytes ¶
func GetSchemeAndHost ¶
func ValidateToken ¶
func ValidateToken(tokenString string, configuration WellKnownConfiguration, clientId string) (interface{}, error)
Types ¶
type AccessTokenResultSet ¶
type AccessTokenResultSet struct {
AccessToken string `json:"access_token"`
TokenType string `json:"token_type"`
ExpiresIn int `json:"expires_in"`
ExpiresAt int64 `json:"expires_at"`
}
type AuthorisationResponse ¶
func ValidateAuthorisationResponse ¶
func ValidateAuthorisationResponse(url *url.URL, state string) (AuthorisationResponse, error)
type CodeVerifier ¶
func GenerateCodeVerifier ¶
func GenerateCodeVerifier() (CodeVerifier, error)
type RefreshResult ¶
type RefreshResult struct {
RefreshToken string `json:"refresh_token"`
AccessToken string `json:"access_token"`
ExpiresIn int `json:"expires_in"`
TokenType string `json:"token_type"`
}
func RefreshToken ¶
type TokenResultSet ¶
type TokenResultSet struct {
AccessToken string `json:"access_token"`
IdentityToken string `json:"id_token"`
RefreshToken string `json:"refresh_token"`
TokenType string `json:"token_type"`
ExpiresIn int `json:"expires_in"`
ExpiresAt int64 `json:"expires_at"`
}
func ExchangeCodeForToken ¶
type WellKnownConfiguration ¶
type WellKnownConfiguration struct {
AuthorisationEndpoint string `json:"authorization_endpoint"`
TokenEndpoint string `json:"token_endpoint"`
JwksUri string `json:"jwks_uri"`
Issuer string `json:"issuer"`
}
func GetMetadata ¶
func GetMetadata(authority string) (WellKnownConfiguration, error)
Click to show internal directories.
Click to hide internal directories.