|
|
@ -1,16 +1,38 @@ |
|
|
package keycloak |
|
|
package keycloak |
|
|
|
|
|
|
|
|
// Get authenticator providers Returns a list of authenticator providers.
|
|
|
import "gopkg.in/h2non/gentleman.v2/plugins/url" |
|
|
// GET /{realm}/authentication/authenticator-providers
|
|
|
|
|
|
|
|
|
const ( |
|
|
// Get client authenticator providers Returns a list of client authenticator providers.
|
|
|
authenticationManagementPath = "/auth/admin/realms/:realm/authentication" |
|
|
// GET /{realm}/authentication/client-authenticator-providers
|
|
|
) |
|
|
|
|
|
|
|
|
// Get authenticator provider’s configuration description
|
|
|
// GetAuthenticatorProviders returns a list of authenticator providers.
|
|
|
// GET /{realm}/authentication/config-description/{providerId}
|
|
|
func (c *Client) GetAuthenticatorProviders(realmName string) ([]map[string]interface{}, error) { |
|
|
|
|
|
var resp = []map[string]interface{}{} |
|
|
// Get authenticator configuration
|
|
|
var err = c.get(&resp, url.Path(authenticationManagementPath+"/authenticator-providers"), url.Param("realm", realmName)) |
|
|
// GET /{realm}/authentication/config/{id}
|
|
|
return resp, err |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// GetClientAuthenticatorProviders returns a list of client authenticator providers.
|
|
|
|
|
|
func (c *Client) GetClientAuthenticatorProviders(realmName string) ([]map[string]interface{}, error) { |
|
|
|
|
|
var resp = []map[string]interface{}{} |
|
|
|
|
|
var err = c.get(&resp, url.Path(authenticationManagementPath+"client-authenticator-providers"), url.Param("realm", realmName)) |
|
|
|
|
|
return resp, err |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// GetAuthenticatorProviderConfig returns the authenticator provider’s configuration description.
|
|
|
|
|
|
func (c *Client) GetAuthenticatorProviderConfig(realmName, providerID string) (AuthenticatorConfigInfoRepresentation, error) { |
|
|
|
|
|
var resp = AuthenticatorConfigInfoRepresentation{} |
|
|
|
|
|
var err = c.get(&resp, url.Path(authenticationManagementPath+"config-description/:providerID"), url.Param("realm", realmName), url.Param("providerID", providerID)) |
|
|
|
|
|
return resp, err |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// GetAuthenticatorConfig returns the authenticator configuration.
|
|
|
|
|
|
func (c *Client) GetAuthenticatorConfig(realmName, configID string) (AuthenticatorConfigRepresentation, error) { |
|
|
|
|
|
var resp = AuthenticatorConfigRepresentation{} |
|
|
|
|
|
var err = c.get(&resp, url.Path(authenticationManagementPath+"config/:id"), url.Param("realm", realmName), url.Param("id", configID)) |
|
|
|
|
|
return resp, err |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
// Update authenticator configuration
|
|
|
// Update authenticator configuration
|
|
|
// PUT /{realm}/authentication/config/{id}
|
|
|
// PUT /{realm}/authentication/config/{id}
|
|
|
|