keycloak

package
v0.0.0-...-5f3117a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 6, 2019 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Keycloak

type Keycloak struct {
	// contains filtered or unexported fields
}

func NewKeycloak

func NewKeycloak(ctx context.Context, keycloakConfig *viper.Viper) *Keycloak

type KeycloakInfo

type KeycloakInfo struct {
	// contains filtered or unexported fields
}

type KeycloakRepository

type KeycloakRepository struct {
	// contains filtered or unexported fields
}

func NewKeycloakRepository

func NewKeycloakRepository(keycloak *Keycloak, rest *KeycloakRest) *KeycloakRepository

func (*KeycloakRepository) GetRoleMappingsByUserId

func (k *KeycloakRepository) GetRoleMappingsByUserId(userId string) ([]*UserRole, error)

type KeycloakRest

type KeycloakRest struct {
	// contains filtered or unexported fields
}

func NewKeycloakRest

func NewKeycloakRest(ctx context.Context, config *viper.Viper) (*KeycloakRest, error)

func (*KeycloakRest) GetClientRoleMapping

func (k *KeycloakRest) GetClientRoleMapping() (map[string]*gocloak.Role, error)

func (*KeycloakRest) GetRoleMappingsByUserId

func (k *KeycloakRest) GetRoleMappingsByUserId(userId string) ([]gocloak.Role, error)

type KeycloakService

type KeycloakService struct {
	// contains filtered or unexported fields
}

func NewKeycloakService

func NewKeycloakService(keycloakRepository *KeycloakRepository) *KeycloakService

func (*KeycloakService) ConvertToken

func (k *KeycloakService) ConvertToken(ctx context.Context, rawIDToken interface{}) (*User, error)

func (*KeycloakService) GetAuthCodeURL

func (k *KeycloakService) GetAuthCodeURL() string

func (*KeycloakService) GetRolesByUserId

func (k *KeycloakService) GetRolesByUserId(userId string) ([]*UserRole, error)

func (*KeycloakService) Verify

func (k *KeycloakService) Verify(ctx context.Context, part string) (token *oidc.IDToken, err error)

func (*KeycloakService) VerifyCallback

func (k *KeycloakService) VerifyCallback(ctx context.Context, code string) (interface{}, error)

type OAuthInfo

type OAuthInfo struct {
	// contains filtered or unexported fields
}

type User

type User struct {
	UserToken  UserToken
	RawIDToken interface{}
	UserRoles  []*UserRole
}

type UserRole

type UserRole struct {
	Name string
}

type UserToken

type UserToken struct {
	Jti                string
	Exp                int
	Nbf                int
	Iat                int
	Iss                string
	Aud                string
	Sub                string
	Typ                string
	Azp                string
	Auth_time          int
	Session_state      string
	Acr                string
	Email_verified     bool
	Name               string
	Preferred_username string
	Given_name         string
	Family_name        string
	Email              string
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL