Browse Source

Add execute actions email

master
harture 7 years ago
parent
commit
a2084315ea
  1. 12
      users.go

12
users.go

@ -13,6 +13,7 @@ const (
userIDPath = userPath + "/:id" userIDPath = userPath + "/:id"
resetPasswordPath = userIDPath + "/reset-password" resetPasswordPath = userIDPath + "/reset-password"
sendVerifyEmailPath = userIDPath + "/send-verify-email" sendVerifyEmailPath = userIDPath + "/send-verify-email"
executeActionsEmailPath = userIDPath + "/execute-actions-email"
getCredentialsForUserPath = "/auth/realms/:realmReq/api/admin/realms/:realm/users/:id/credentials" getCredentialsForUserPath = "/auth/realms/:realmReq/api/admin/realms/:realm/users/:id/credentials"
deleteCredentialsForUserPath = getCredentialsForUserPath + "/:credid" deleteCredentialsForUserPath = getCredentialsForUserPath + "/:credid"
) )
@ -77,6 +78,17 @@ func (c *Client) SendVerifyEmail(accessToken string, realmName string, userID st
return c.put(accessToken, plugins...) return c.put(accessToken, plugins...)
} }
// ExecuteActionsEmail sends an update account email to the user. An email contains a link the user can click to perform a set of required actions.
func (c *Client) ExecuteActionsEmail(accessToken string, realmName string, userID string, actions []string, paramKV ...string) error {
if len(paramKV)%2 != 0 {
return fmt.Errorf("the number of key/val parameters should be even")
}
var plugins = append(createQueryPlugins(paramKV...), url.Path(executeActionsEmailPath), url.Param("realm", realmName), url.Param("id", userID), body.JSON(actions))
return c.put(accessToken, plugins...)
}
// GetCredentialsForUser gets the credential list for a user // GetCredentialsForUser gets the credential list for a user
func (c *Client) GetCredentialsForUser(accessToken string, realmReq, realmName string, userID string) ([]CredentialRepresentation, error) { func (c *Client) GetCredentialsForUser(accessToken string, realmReq, realmName string, userID string) ([]CredentialRepresentation, error) {
var resp = []CredentialRepresentation{} var resp = []CredentialRepresentation{}

Loading…
Cancel
Save