keycloak

package
v0.6.80 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GRANT_CLIENT_CREDENTIALS         = "client_credentials"
	GRANT_PASSWORD                   = "password"
	REALM_MANAGEMENT_CLIENT          = "realm-management"
	ERROR_401_UNATHORIZED            = "401 Unauthorized: HTTP 401 Unauthorized"
	ERROR_CLIENT_SECRET_NOT_PROVIDED = "Client secret not provided in request"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type IKeycloak

type IKeycloak interface {
	//
	IsDebug() bool
	Login(username string, password string) (*gocloak.JWT, error)
	GetToken(tokenOptions gocloak.TokenOptions) (*gocloak.JWT, error)
	RefreshToken(refreshToken string) (*gocloak.JWT, error)
	Logout(refreshToken string) error
	GetUserEmail(email string) (*gocloak.User, error)
	CreateUser(user gocloak.User) (string, error)
	UpdateUser(firstName string, lastName string, username string, attributes map[string][]string, realmRoles []string) (bool, error)
	SetPassword(userID, realm, password string, temporary bool) error
	LogoutUserSession(session string) error
	CreateGroup(group gocloak.Group) (string, error)
	// *** Client Roles ***
	AddClientRoleToUser(idOfClient, userID string, roles []gocloak.Role) error
	// *** Realm ***
	GetRealm(realm string) (*gocloak.RealmRepresentation, error)
	GetRealms() ([]*gocloak.RealmRepresentation, error)
	CreateRealm(realm gocloak.RealmRepresentation) (string, error)
	UpdateRealm(realm gocloak.RealmRepresentation) error
	DeleteRealm(realm string) error
}

func NewKeycloak

func NewKeycloak(ctx context.Context, realm string, server string, clientId string, clientSecret string, isDebug bool) (IKeycloak, error)

Jump to

Keyboard shortcuts

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