|
|
|
@ -9,14 +9,16 @@ import ( |
|
|
|
|
|
|
|
const ( |
|
|
|
userPath = "/auth/admin/realms/:realm/users" |
|
|
|
usersAdminExtensionApiPath = "/auth/realms/:realmReq/api/admin/realms/:realm/users" |
|
|
|
usersAdminExtensionApiPath = "/auth/realms/:realmReq/api/admin/realms/:realm/users" |
|
|
|
userCountPath = userPath + "/count" |
|
|
|
userIDPath = userPath + "/:id" |
|
|
|
userGroupsPath = userIDPath + "/groups" |
|
|
|
resetPasswordPath = userIDPath + "/reset-password" |
|
|
|
sendVerifyEmailPath = userIDPath + "/send-verify-email" |
|
|
|
executeActionsEmailPath = userIDPath + "/execute-actions-email" |
|
|
|
getCredentialsForUserPath = usersAdminExtensionApiPath +"/:id/credentials" |
|
|
|
smsAPI = "/auth/realms/:realm/smsApi" |
|
|
|
sendNewEnrolmentCode = smsAPI + "/sendNewCode" |
|
|
|
getCredentialsForUserPath = usersAdminExtensionApiPath + "/:id/credentials" |
|
|
|
deleteCredentialsForUserPath = getCredentialsForUserPath + "/:credid" |
|
|
|
) |
|
|
|
|
|
|
|
@ -98,6 +100,17 @@ func (c *Client) ExecuteActionsEmail(accessToken string, realmName string, userI |
|
|
|
return c.put(accessToken, plugins...) |
|
|
|
} |
|
|
|
|
|
|
|
// Send a new enrolment code
|
|
|
|
func (c *Client) SendNewEnrolmentCode(accessToken string, realmName string, userID string) error { |
|
|
|
|
|
|
|
var paramKV []string |
|
|
|
paramKV = append(paramKV, "userid", userID) |
|
|
|
var plugins = append(createQueryPlugins(paramKV...), url.Path(sendNewEnrolmentCode), url.Param("realm", realmName)) |
|
|
|
|
|
|
|
_, err := c.post(accessToken, nil, plugins...) |
|
|
|
return err |
|
|
|
} |
|
|
|
|
|
|
|
// GetCredentialsForUser gets the credential list for a user
|
|
|
|
func (c *Client) GetCredentialsForUser(accessToken string, realmReq, realmName string, userID string) ([]CredentialRepresentation, error) { |
|
|
|
var resp = []CredentialRepresentation{} |
|
|
|
|