Solved

Update IAM user within procedure (API)

  • 18 October 2022
  • 4 replies
  • 98 views

We have a registration form (frontend) that performs an API call to our database. In the API procedure we check whether the entered data corresponds with the data in the database. Then we check if there is an existing IAM user. If no, we create a new IAM user, if yes, we want to update the existing IAM user. Checking the data in the IAM database and creating a new IAM user works fine. However when trying to  update a IAM user (the email address) we get a 422 error code. Should it be possible to update an IAM user E-mailadress? Or is there a setting or constraint that prevents it from working?

icon

Best answer by Mark Jongeling 19 October 2022, 07:03

View original

This topic has been closed for comments

4 replies

Userlevel 7
Badge +5

The TSFMessages header in the response might provide a hint on the underlying error.

Can you share this error message?

Respons headers »

tsfmessages:

eyJNZXNzYWdlVHlwZSI6IkFwcGxpY2F0aW9uRGJNZXNzYWdlIiwiTWVzc2FnZUlEIjoibm90X2F1dGhvcml6ZWRfdXNyX2FkbWluIiwiUmF3TWVzc2FnZSI6Ijxtc2cgaWQ9XCJub3RfYXV0aG9yaXplZF91c3JfYWRtaW5cIj48L21zZz4iLCJOYW1lZFBhcmFtZXRlcnMiOltdLCJUcmFuc2xhdGVkTWVzc2FnZSI6bnVsbH0=

Userlevel 7
Badge +23

Hi, 

The message after decoding (link) is:

{"MessageType":"ApplicationDbMessage","MessageID":"not_authorized_usr_admin","RawMessage":"<msg id=\"not_authorized_usr_admin\"></msg>","NamedParameters":[],"TranslatedMessage":null}

Meaning that the API call is performed by someone who is not an authorized user administrator.

Thank you. With your help I found the cause of the error. The issue is indeed related to the authorisation of the user. In the Software Factory I have updated the role correctly. However the authorisation that is meant in de error message is the authorisation in the IAM.