Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrTokenNotPresentInHeader error = errors.New("token in header 'Authorization' not found")
)
Functions ¶
func AuthEndpoints ¶
func AuthEndpoints(r *gin.Engine) *gin.RouterGroup
func JwtAuthMiddleware ¶
func JwtAuthMiddleware() gin.HandlerFunc
Types ¶
type JwtClaimNeeded ¶
type JwtClaimNeeded struct { Email string `json:"email"` Name string `json:"name"` PreferredUsername string `json:"preferred_username"` }
func ValidateToken ¶
func ValidateToken(c *gin.Context) (claims *JwtClaimNeeded, err error)
type OAuth2Config ¶
type OAuth2Config struct { Type OAuth2ConfigAuthType `json:"type" binding:"required"` Scope string `json:"scope" binding:"required"` Issuer string `json:"issuer" binding:"required"` ClientID string `json:"client_id" binding:"required"` }
type OAuth2ConfigAuthType ¶
type OAuth2ConfigAuthType string
const AzureAD OAuth2ConfigAuthType = "azure_ad"
const Default OAuth2ConfigAuthType = "default"
Click to show internal directories.
Click to hide internal directories.