Browse Source

Add send new enrolment code API

master
Sonia 7 years ago
committed by harture
parent
commit
b007b335eb
  1. 15
      users.go

15
users.go

@ -16,7 +16,9 @@ const (
resetPasswordPath = userIDPath + "/reset-password" resetPasswordPath = userIDPath + "/reset-password"
sendVerifyEmailPath = userIDPath + "/send-verify-email" sendVerifyEmailPath = userIDPath + "/send-verify-email"
executeActionsEmailPath = userIDPath + "/execute-actions-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" deleteCredentialsForUserPath = getCredentialsForUserPath + "/:credid"
) )
@ -98,6 +100,17 @@ func (c *Client) ExecuteActionsEmail(accessToken string, realmName string, userI
return c.put(accessToken, plugins...) 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 // 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