Cannot update password in WSO2 with a request

95 views Asked by At

I'm trying to make a HTTP request to modify password from users that are stored into WSO2. I'm using the following request:

{
  method: 'PUT',
  url: domain + '/wso2/scim/Users/' + userId,
  rejectUnauthorized: false,
  headers: {
    Authorization: 'Bearer ' + scimToken,
    'Content-Type': 'application/json'
  },
  json: true,
  body: {
    userName : 'foo',
    password : 'newPassw0rd'
  }
}

But response returns a Java exception (I don't attach it here, because is too long and I think that doesn't have sense. Is related with Apache CXF).

I'm so new with SCIM and WSO2, so I think that I'm making a mistake in the request. Does anyone knows what's wrong?

Thanks!

1

There are 1 answers

1
Gayan On

create user with this request: curl -v -k --user admin:admin --data '{"schemas":[],"name":{"familyName":"gunasinghe","givenName":"hasinitg"},"userName":"hasinitg","password":"hasinitg","emails":[{"primary":true,"value":"hasini_home.com","type":"home"},{"value":"hasini_work.com","type":"work"}]}' --header "Content-Type:application/json" https://localhost:9443/wso2/scim/Users

update password

curl -v -k --user admin:admin -X PUT -d '{"schemas":[],"name":{"familyName":"gunasinghe","givenName":"hasinitg"},"userName":"hasinitg", "password":"pwd123","emails":[{"value":"[email protected]","type":"work"},{"value":"[email protected]","type":"home"}]}' --header "Content-Type:application/json" https://localhost:9443/wso2/scim/Users/0032fd29-55a9-4fb9-be82-b1c97c073f02