Skip to content

Commit

Permalink
Merge pull request #109 from cloudtrust/edulog-evol3
Browse files Browse the repository at this point in the history
[EDKEDULOG-392] Modules for IDPs
  • Loading branch information
clefrancq authored Sep 21, 2023
2 parents 3b03161 + 6c6bbb9 commit ead23e4
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions api/identity_providers.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package api

import (
"github.com/cloudtrust/keycloak-client/v2"
"gopkg.in/h2non/gentleman.v2/plugins/body"
"gopkg.in/h2non/gentleman.v2/plugins/url"
)

Expand All @@ -18,6 +19,11 @@ func (c *Client) GetIdps(accessToken string, realmName string) ([]keycloak.Ident
return resp, err
}

// UpdateIdp updates the identity provider. idpAlias is the alias of identity provider.
func (c *Client) UpdateIdp(accessToken string, realmName, idpAlias string, idpRep keycloak.IdentityProviderRepresentation) error {
return c.put(accessToken, url.Path(idpAliasPath), url.Param("realm", realmName), url.Param("alias", idpAlias), body.JSON(idpRep))
}

// GetIdp gets an identity provider matching the given alias
func (c *Client) GetIdp(accessToken string, realmName string, idpAlias string) (keycloak.IdentityProviderRepresentation, error) {
var resp = keycloak.IdentityProviderRepresentation{}
Expand Down

0 comments on commit ead23e4

Please sign in to comment.