Skip to content

Commit

Permalink
fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
harture committed May 1, 2019
1 parent 5bc7354 commit 09bbe4e
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 18 deletions.
34 changes: 18 additions & 16 deletions Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions pkg/management/component.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ type KeycloakClient interface {
GetGroupsOfUser(accessToken string, realmName, userID string) ([]kc.GroupRepresentation, error)
UpdateUser(accessToken string, realmName, userID string, user kc.UserRepresentation) error
GetUsers(accessToken string, reqRealmName, targetRealmName string, paramKV ...string) ([]kc.UserRepresentation, error)
CreateUser(accessToken string, realmName string, user kc.UserRepresentation) (string, error)
CreateUser(accessToken string, reqRealmName, targetRealmName string, user kc.UserRepresentation) (string, error)
GetClientRoleMappings(accessToken string, realmName, userID, clientID string) ([]kc.RoleRepresentation, error)
AddClientRolesToUserRoleMapping(accessToken string, realmName, userID, clientID string, roles []kc.RoleRepresentation) error
GetRealmLevelRoleMappings(accessToken string, realmName, userID string) ([]kc.RoleRepresentation, error)
Expand Down Expand Up @@ -171,12 +171,13 @@ func (c *component) GetClients(ctx context.Context, realmName string) ([]api.Cli

func (c *component) CreateUser(ctx context.Context, realmName string, user api.UserRepresentation) (string, error) {
var accessToken = ctx.Value("access_token").(string)
var ctxRealm = ctx.Value("realm").(string)

var userRep kc.UserRepresentation

userRep = api.ConvertToKCUser(user)

locationURL, err := c.keycloakClient.CreateUser(accessToken, realmName, userRep)
locationURL, err := c.keycloakClient.CreateUser(accessToken, ctxRealm, realmName, userRep)

if err != nil {
return "", err
Expand Down

0 comments on commit 09bbe4e

Please sign in to comment.