Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Roles ¶
Roles represented as map to make it easier to lookup a role.
func (Roles) Add ¶
Add Role to Roles using Role.Name as key. Add will replace any role with the same name.
type User ¶
type User struct {
Id string `json:"id"`
Username string `json:"preferred_username"`
Email string `json:"email,omitempty"`
EmailVerified string `json:"email_verified,omitempty"`
Name string `json:"name,omitempty"`
// contains filtered or unexported fields
}
User represent current user information, usually information contained in OIDC ID Token, see https://auth0.com/docs/secure/tokens/id-tokens/id-token-structure for available claims. However, since we are using keycloak as our default IdP we should adapt to keycloak about which fields are optional. As of this writing, only Id (sub) and username (preferred_username) is mandatory in keycloak.
func UserFromContext ¶
UserFromContext return stored user in the context, return user, true if found or return nil, false otherwise.