Documentation
¶
Index ¶
- Constants
- func GetEmail(ctx context.Context) string
- func GroupsClaim(token jwt.Token) ([]string, error)
- func MockTokenValidator() func(next http.Handler) http.Handler
- func StringClaim(claimName string, token jwt.Token) (string, error)
- func UserInNaisdeviceApprovalGroup(groups []string) bool
- func WithEmail(ctx context.Context, email string) context.Context
- type Azure
- type Google
- type TokenValidator
- type User
Constants ¶
View Source
const NaisDeviceApprovalGroup = "ffd89425-c75c-4618-b5ab-67149ddbbc2d"
Variables ¶
This section is empty.
Functions ¶
func GroupsClaim ¶
GroupsClaim returns the value of the "groups" claim from a JWT token.
func StringClaim ¶
StringClaim returns the value of a string claim from a JWT token. If the claim is not present or empty, it returns an error.
Types ¶
type Azure ¶
func (Azure) JwksEndpoint ¶
func (*Azure) JwtOptions ¶
func (a *Azure) JwtOptions() []jwt.ParseOption
func (*Azure) TokenValidatorMiddleware ¶
func (a *Azure) TokenValidatorMiddleware() TokenValidator
type Google ¶
type Google struct {
ClientID string
AllowedDomains []string
// contains filtered or unexported fields
}
func (*Google) JwtOptions ¶
func (g *Google) JwtOptions() []jwt.ParseOption
func (*Google) ParseAndValidateToken ¶
func (*Google) SetupJwkSetAutoRefresh ¶
func (*Google) TokenValidatorMiddleware ¶
func (g *Google) TokenValidatorMiddleware() TokenValidator
Click to show internal directories.
Click to hide internal directories.