keycloak

package
Version: v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2021 License: EUPL-1.2 Imports: 5 Imported by: 3

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, error)

NewKeyCloakClient initializes a new Client struct and connects to Keycloak

func (Client) AddMemberToGroup

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

AddMemberToGroup adds a member to a Group

func (Client) CreateGroup

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

CreateGroup creates a group in KeyCloak

func (Client) CreateUser

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

CreateUser creates a user in KeyCloak

func (Client) GetAllUsers

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

GetAllUsers gets all Users from Keycloak

func (Client) GetGroupID

func (keyCloakClient Client) GetGroupID(groupName string) (string, error)

GetGroupID gets a group from KeyCloak and returns the ID

func (Client) GetGroupMembers

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

GetGroupMembers gets members of a Group

func (Client) GetGroups

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

GetGroups fetches all groups from KeyCloak

func (Client) GetUser

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

GetUser gets a User from KeyCloak

func (Client) GetUserCount added in v0.2.1

func (keyCloakClient Client) GetUserCount() (int, error)

func (Client) GetUserID

func (keyCloakClient Client) GetUserID(username string) (string, error)

GetUserID gets the ID of a user

func (Client) RemoveGroup

func (keyCloakClient Client) RemoveGroup(groupID string) error

RemoveGroup removes a group from KeyCloak

func (Client) RemoveMemberFromGroup

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

RemoveMemberFromGroup removes a member from a Group

func (Client) SearchUser

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

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
t or T : Toggle theme light dark auto
y or Y : Canonical URL