Documentation ¶
Index ¶
- Constants
- Variables
- func JWTValidator(certificates map[string]CertificateList, audience string) jwt.Keyfunc
- type Azure
- func (a *Azure) ConvertEmailsToIdents(emails []string) ([]string, error)
- func (a *Azure) FetchCertificates() (map[string]CertificateList, error)
- func (a *Azure) KeyDiscoveryURL() string
- func (a *Azure) UserExistsInAzureAD(user string) error
- func (a *Azure) ValidateUser(certificates map[string]CertificateList, token string) (*User, error)
- func (a *Azure) Verify(ctx context.Context, rawIDToken string) (*oidc.IDToken, error)
- type AzureGroupWithID
- type CertificateList
- type EncodedCertificate
- type Key
- type KeyDiscovery
- type Session
- type TokenResponse
- type User
Constants ¶
View Source
const ( AzureUsersEndpoint = "https://graph.microsoft.com/v1.0/users" AzureGroupsEndpoint = "https://graph.microsoft.com/v1.0/groups" )
Variables ¶
View Source
var ErrAzureTokenExpired = fmt.Errorf("token expired")
Functions ¶
func JWTValidator ¶
func JWTValidator(certificates map[string]CertificateList, audience string) jwt.Keyfunc
Types ¶
type Azure ¶
func NewAzureClient ¶
func (*Azure) ConvertEmailsToIdents ¶
func (*Azure) FetchCertificates ¶
func (a *Azure) FetchCertificates() (map[string]CertificateList, error)
func (*Azure) KeyDiscoveryURL ¶
func (*Azure) UserExistsInAzureAD ¶
func (*Azure) ValidateUser ¶
type AzureGroupWithID ¶
type CertificateList ¶
type CertificateList []*x509.Certificate
type EncodedCertificate ¶
type EncodedCertificate string
func (EncodedCertificate) Decode ¶
func (c EncodedCertificate) Decode() (*x509.Certificate, error)
Decode a base64 encoded certificate into a X509 structure.
type Key ¶
type Key struct { Kid string `json:"kid"` X5c []EncodedCertificate `json:"x5c"` }
type KeyDiscovery ¶
type KeyDiscovery struct {
Keys []Key `json:"keys"`
}
func DiscoverURL ¶
func DiscoverURL(url string) (*KeyDiscovery, error)
func (*KeyDiscovery) Map ¶
func (k *KeyDiscovery) Map() (result map[string]CertificateList, err error)
Map transform a KeyDiscovery object into a dictionary with "kid" as key and lists of decoded X509 certificates as values.
Returns an error if any certificate does not decode.
type TokenResponse ¶
type TokenResponse struct {
AccessToken string `json:"access_token"`
}
Click to show internal directories.
Click to hide internal directories.