rich.steenwyk (Community Member) asked a question.

Identity API support for custom fields?

It appears that there is no support for retrieving 'custom_fields' attached to user records via the newer REST Identity API. The original XML API provided this functionality via the getuserinfo.do endpoint.

 

Is support for custom_fields on the roadmap for support in the REST Identity API?

 

Since it isn't, I've resorted to using the XML API, but am receiving a 200 OK "Access Denied" when trying to look up a SAML user using the 'custom_id' query parameter.

 

I was met with the same result on attempts to access a SAML user using credentials from both a human-user account with the Administrator role and from an API account with the Admin API role. The same credentials are able to load any other non-SAML user account in the system using the 'username' query parameter.

 

Works: http --auth-type=veracode_hmac --verify my.crt --debug --json GET "https://analysiscenter.veracode.com/api/3.0/getuserinfo.do" "username==<username>"

 

Fails: http --auth-type=veracode_hmac --verify my.crt --debug --json GET "https://analysiscenter.veracode.com/api/3.0/getuserinfo.do" "custom_id==<saml_subject>"


VCode and rich.steenwyk like this.
  • Hi @rich.steenwyk (Community Member)​ -- just confirming what @Jason M., Veracode Support (Veracode)​ posted--you should definitely see values for custom_one, custom_two, etc. IF those fields are populated. They are omitted from the response if they are not populated. You should be able to set them as well, either at the time of creating the user or via an update. Hope this helps.

    Selected as Best
  • Hello @rich.steenwyk (Community Member)​ ,

     

    When using XML to update SAML, it will update but throw an error, as SAML checks ID and not the email address.  This is a known issue when updating XML API.  I can confirm that custom fields can be customized by using the Identity API.

     

    If you are still having issues, I would recommend you contact our technical support team. Here's how you can log a case:

    1. Navigate to the upper right corner of any page in the Community, click on your user avatar.
    2. Select Contact Support from the drop-down menu.

     

    Jason

    Community Support Engineer

     

    Expand Post
  • Hi @rich.steenwyk (Community Member)​ -- just confirming what @Jason M., Veracode Support (Veracode)​ posted--you should definitely see values for custom_one, custom_two, etc. IF those fields are populated. They are omitted from the response if they are not populated. You should be able to set them as well, either at the time of creating the user or via an update. Hope this helps.

    Selected as Best
    • rich.steenwyk (Community Member)

      I've confirmed that the values are indeed there in the REST API response.

       

      However, I also discovered another quirk. The REST API for updating a user's custom fields rejects any values with (at least) the colon (":") character in them. The same restriction is not present when saving values in custom fields via the web application

       

      I suspect HTML encoding could be used to avoid this, but I did not test that.

      Expand Post
      • Hi @rich.steenwyk (Community Member)​ , thanks for reporting. It looks like there's some undocumented validation on those fields that only allow alphanumeric characters, underscores, dashes, periods, and spaces.

         

        I'll see if I can get the documentation cleaned up, but can you give me an idea of why you were passing a value containing a colon here?

        Expand Post
      • I hit "send" too soon, looks like we support entering valid URLs as well as the supported characters shown above.

      • rich.steenwyk (Community Member)

        The value I was storing in there was a timestamp in ISO 8601 format, i.e. YYYY-MM-DDtHH:MM:SS.ffffff

Topics (3)

No articles found
Loading

Ask the Community

Get answers, share a use case, discuss your favorite features, or get input from the community.