keycloak

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2021 License: EUPL-1.2 Imports: 5 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client struct with api methods and accesstoken

func NewKeyCloakClient

func NewKeyCloakClient(keycloakURL string, realm string) *Client

NewKeyCloakClient initalizes a new Client struct and connects to KeyCloak

func (Client) AddMemberToGroup

func (keyCloakClient Client) AddMemberToGroup(userid string, groupID string)

AddMemberToGroup adds a member to a Group

func (Client) CreateGroup

func (keyCloakClient Client) CreateGroup(groupName string, tenant string)

CreateGroup creates a group in KeyCloak

func (Client) CreateUser

func (keyCloakClient Client) CreateUser(user *gocloak.User)

CreateUser creates a user in KeyCloak

func (Client) GetAllUsers

func (keyCloakClient Client) GetAllUsers() []*gocloak.User

GetAllUsers gets all Users from Keycloak

func (Client) GetGroupID

func (keyCloakClient Client) GetGroupID(groupName string) (groupID string)

GetGroupID gets a group from KeyCloak and returns the ID

func (Client) GetGroupMembers

func (keyCloakClient Client) GetGroupMembers(groupID string) []*gocloak.User

GetGroupMembers gets members of a Group

func (Client) GetGroups

func (keyCloakClient Client) GetGroups() []*gocloak.Group

GetGroups fetches all groups from KeyCloak

func (Client) GetUser

func (keyCloakClient Client) GetUser(username string) (user *gocloak.User)

GetUser gets a User from KeyCloak

func (Client) GetUserCount added in v0.2.1

func (keyCloakClient Client) GetUserCount() int

func (Client) GetUserID

func (keyCloakClient Client) GetUserID(username string) string

GetUserID gets the ID of a user

func (Client) RemoveGroup

func (keyCloakClient Client) RemoveGroup(groupID string)

RemoveGroup removes a group from KeyCloak

func (Client) RemoveMemberFromGroup

func (keyCloakClient Client) RemoveMemberFromGroup(userid string, groupID string)

RemoveMemberFromGroup removes a member from a Group

func (Client) SearchUser

func (keyCloakClient Client) SearchUser(username string) (user *gocloak.User)

SearchUser searches a User in KeyCloak

func (Client) UserExists added in v0.2.1

func (keyCloakClient Client) UserExists(username string) (bool, error)

Check if a user exists in keycloak and return true if it does, false if it does not

Jump to

Keyboard shortcuts

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