Documentation ¶
Index ¶
- Constants
- Variables
- func GenerateCodeVerifier() string
- func SetAccessTokenCtx(ctx context.Context, val AccessToken) context.Context
- func ValidateScope(scope []string) error
- type AccessToken
- type Account
- type AuthorizeParam
- type Cert
- type CodeChallenge
- type CodeChallengeMethod
- type IDToken
- type JWTSignKey
- type LoggedIn
- type OIDCClient
- type RefreshToken
Constants ¶
View Source
const LoginVeiw = `` /* 3220-byte string literal not displayed */
Variables ¶
View Source
var AllowedScopes = []string{
"openid",
"profile",
"email",
}
Functions ¶
func GenerateCodeVerifier ¶
func GenerateCodeVerifier() string
func SetAccessTokenCtx ¶
func SetAccessTokenCtx( ctx context.Context, val AccessToken, ) context.Context
func ValidateScope ¶
Types ¶
type AccessToken ¶
type AccessToken struct { Iss string `json:"iss"` Sub string `json:"sub"` Exp int64 `json:"exp"` Iat int64 `json:"iat"` Aud string `json:"aud"` Jti string `json:"jti"` Scope []string `json:"scope"` ClientID string `json:"clientId"` }
func GenerateAccessToken ¶
func GetAccessTokenCtx ¶
func GetAccessTokenCtx( ctx context.Context, ) AccessToken
func ParseAccessToken ¶
func ParseAccessToken( str string, sign string, ) (AccessToken, error)
func (AccessToken) JWT ¶
func (at AccessToken) JWT( sign string, ) string
type AuthorizeParam ¶
type CodeChallenge ¶
type CodeChallenge struct { Challenge string Method CodeChallengeMethod }
func GenerateCodeChallenge ¶
func GenerateCodeChallenge(verifier string) CodeChallenge
func (CodeChallenge) Verify ¶
func (cc CodeChallenge) Verify(verifier string) error
type CodeChallengeMethod ¶
type CodeChallengeMethod string
const (
CodeChallengeMethodS256 CodeChallengeMethod = "S256"
)
type IDToken ¶
type IDToken struct { Iss string `json:"iss"` Sub string `json:"sub"` Aud string `json:"aud"` Nonce string `json:"nonce"` Exp int64 `json:"exp"` Iat int64 `json:"iat"` Profile *string `json:"profile"` Email *string `json:"email"` }
ref. https://openid.net/specs/openid-connect-core-1_0.html#StandardClaims
func GenerateIDToken ¶
func (IDToken) RSA256 ¶
func (it IDToken) RSA256( signkey JWTSignKey, ) string
type JWTSignKey ¶
type JWTSignKey struct { ID string Key *rsa.PrivateKey }
func GenerateJWTSignKey ¶
func GenerateJWTSignKey() (*JWTSignKey, error)
func (JWTSignKey) Cert ¶
func (jsk JWTSignKey) Cert() Cert
type OIDCClient ¶
func GenerateTestOIDCClient
deprecated
func GenerateTestOIDCClient( id string, name string, secret string, redirectURI string, ) OIDCClient
Deprecated: use local test data.
func (*OIDCClient) CompareSecret ¶
func (oc *OIDCClient) CompareSecret( secret string, ) error
type RefreshToken ¶
type RefreshToken string
func GenerateRefreshToken ¶
func GenerateRefreshToken() RefreshToken
func ParseRefreshToken ¶
func ParseRefreshToken(str string) (RefreshToken, error)
func (RefreshToken) Base64 ¶
func (rt RefreshToken) Base64() string
Click to show internal directories.
Click to hide internal directories.