Documentation ¶
Index ¶
- Constants
- Variables
- type Claims
- type User
- type UserInfo
- func (i *UserInfo) GetEmail() string
- func (i *UserInfo) GetGroups() []string
- func (i *UserInfo) GetIssuer() string
- func (i *UserInfo) GetLabels() map[string]string
- func (i *UserInfo) GetMrn() string
- func (i *UserInfo) GetName() string
- func (i *UserInfo) GetSignInProvider() string
- func (i *UserInfo) GetSubject() string
Constants ¶
View Source
const ( ClaimIssuer = "iss" ClaimSubject = "sub" ClaimEmail = "email" ClaimEmailVerified = "email_verified" ClaimName = "name" ClaimGivenName = "given_name" ClaimFamilyName = "family_name" ClaimGroups = "groups" ClaimPicture = "picture" )
default claim names
Variables ¶
View Source
var Anonymous = &UserInfo{
Subject: "anonymous",
Name: "anonymous",
Issuer: "system/anonymous",
}
View Source
var SystemAdmin = &UserInfo{
Subject: "admin",
Issuer: "system/admin",
Name: "system-admin",
}
Functions ¶
This section is empty.
Types ¶
type User ¶
type User interface { // GetIssuer returns the issuer of the subject id GetIssuer() string // GetSubject returns a unique user id, it is expected to stay stable GetSubject() string // GetName returns a human-readable name of the user GetName() string // GetEmail returns the users email, only if available and verified GetEmail() string // GetGroups returns the names of the groups the user is a member of GetGroups() []string // GetSignInProvider returns the sign-in provider that authenticated the user GetSignInProvider() string // GetLabels returns customer information for the user GetLabels() map[string]string // GetMrn returns the mrn set in the claims, or an empty string if non is found GetMrn() string }
User describes the authenticated user
func ParseClaims ¶
ParseClaims extracts basic information from the claims standard claims are defined in https://openid.net/specs/openid-connect-core-1_0.html#StandardClaims we follow the required fields from google https://developers.google.com/identity/protocols/OpenIDConnect#server-flow required claims: iss, sub optional claims: name, email, email_verified
Click to show internal directories.
Click to hide internal directories.