Documentation ¶
Index ¶
- Variables
- type TokenWrapper
- func (t *TokenWrapper) AccessTokenAsJSON(options ...jwt.ParseOption) string
- func (t *TokenWrapper) AccessTokenAsJWT(options ...jwt.ParseOption) (jwt.Token, error)
- func (t *TokenWrapper) AccessTokenAsString() string
- func (t *TokenWrapper) IDTokenAsJSON(options ...jwt.ParseOption) string
- func (t *TokenWrapper) IDTokenAsJWT(options ...jwt.ParseOption) (jwt.Token, error)
- func (t *TokenWrapper) IDTokenAsString() string
- func (t *TokenWrapper) RefreshTokenAsJSON(options ...jwt.ParseOption) string
- func (t *TokenWrapper) RefreshTokenAsJWT(options ...jwt.ParseOption) (jwt.Token, error)
- func (t *TokenWrapper) RefreshTokenAsString() string
Constants ¶
This section is empty.
Variables ¶
var ErrMissingToken = errors.New("token is missing")
ErrMissingToken indicates, that a specific part of a oauth2.Token is not populated, e.g., typically, refresh token are not returned when acquiring an access token through an OIDC client-credentials flow.
Functions ¶
This section is empty.
Types ¶
type TokenWrapper ¶
TokenWrapper provides JSON marshaling and JWT parsing as well as easy access to a potential id-token to an oauth2.Token. For each of the, potentially, three tokens in an oauth2.Token, i.e., access token, id-token, and refresh token an AsString(), AsJSON(), and AsJWT() function is providing the corresponding
func (*TokenWrapper) AccessTokenAsJSON ¶
func (t *TokenWrapper) AccessTokenAsJSON(options ...jwt.ParseOption) string
AccessTokenAsJWT attempts to parse an access token as JWT and then to marshal the token into JSON. For the plethora of ParseOptions, see github.com/lestrrat-go/jwx.
func (*TokenWrapper) AccessTokenAsJWT ¶
func (t *TokenWrapper) AccessTokenAsJWT(options ...jwt.ParseOption) (jwt.Token, error)
AccessTokenAsJWT attempts to parse an access token as JWT. For the plethora of ParseOptions, see github.com/lestrrat-go/jwx.
func (*TokenWrapper) AccessTokenAsString ¶
func (t *TokenWrapper) AccessTokenAsString() string
AccessTokenAsString returns an access token string.
func (*TokenWrapper) IDTokenAsJSON ¶
func (t *TokenWrapper) IDTokenAsJSON(options ...jwt.ParseOption) string
IDTokenAsJWT attempts to parse an id-token as JWT and then to marshal the token into JSON. For the plethora of ParseOptions, see github.com/lestrrat-go/jwx.
func (*TokenWrapper) IDTokenAsJWT ¶
func (t *TokenWrapper) IDTokenAsJWT(options ...jwt.ParseOption) (jwt.Token, error)
IDTokenAsJWT attempts to parse an id-token as JWT. For the plethora of ParseOptions, see github.com/lestrrat-go/jwx.
func (*TokenWrapper) IDTokenAsString ¶
func (t *TokenWrapper) IDTokenAsString() string
IDTokenAsString returns an id-token string.
func (*TokenWrapper) RefreshTokenAsJSON ¶
func (t *TokenWrapper) RefreshTokenAsJSON(options ...jwt.ParseOption) string
RefreshTokenAsJWT attempts to parse an id-token as JWT and then to marshal the token into JSON. For the plethora of ParseOptions, see github.com/lestrrat-go/jwx.
func (*TokenWrapper) RefreshTokenAsJWT ¶
func (t *TokenWrapper) RefreshTokenAsJWT(options ...jwt.ParseOption) (jwt.Token, error)
RefreshTokenAsJWT attempts to parse a refresh token as JWT. For the plethora of ParseOptions, see github.com/lestrrat-go/jwx.
func (*TokenWrapper) RefreshTokenAsString ¶
func (t *TokenWrapper) RefreshTokenAsString() string
RefreshTokenAsString returns a refresh token string.