I am trying to create a script to do a bulk import of access profile for our users. For this, I am trying to create a script which creates access request, and just after the script is going to validate the access request.
I am currently facing an issue using the API. Each time I’m trying to create an access request, the API request is validated. But when I am going to the UI, I can see that my access request is in error with the following message : “An unexpected error occurred: Requested AppRole Id not found for Access Profile:”.
I tried manually to create a request with the same user and the same access profile with the UI (with the request center, requesting an application access), and it works perfectly, so the error is not coming from the user or the access profile.
Hi masarsa,
I responded to your posting on the IdentityNow Forum - seems you still have the problem!
My next suggestion would be to pair back the access request to a minimum - remove the “removeDate” the “requestType” and the “comment” items from the request to see if it makes a difference.
Regards, Adrian
{
"detailCode": "400.1.0 Required data missing or empty",
"messages": [
{
"locale": "en-US",
"localeOrigin": "DEFAULT",
"text": "Required field \"comment\" for object with id \"2c91808a775e1fc0017768e0c6450cd6\" was missing or empty."
}
],
"trackingId": "b6fa5e1ec7ce4ce0a7af089d71382760"
}
There’s a chance there might a bug at work here. It sounds like you have done the steps correctly but are not getting the intended result. You may wish to file a support ticket. Our Support Team will review the ticket and pass it along to Support Engineering to fix it if needed.
I hope this helps and I hope we can get this resolved for you quickly!
Hi Colin, to call this POST/ access-request API which is the kind of OAuth 2.0 you are using?
Is it “Grant Type - Authorization Code”?
Could you please help me with that?
Thanks in advance!
Which type of OAuth2 you use depends on your use case. If you are developing an application that users will be using, then you should use the Authorization Code grant type, which will require the user to sign in to their IDN account to retrieve their token. This is commonly used in web apps where users sign in.
If this is a script that is running in the background, then you can use a personal access token of an IDN admin to request access on behalf of other users.
Hey @colin_mckibben, I realize I should re-phrase the question.
Can the API set a different “requestedBy” using an IDN admin token? I am good on the “requestedFor” piece. I want check if any way the IDN audit shows the real end user as the requester rather than the IDN admin whose token is being used?
The API will use the API token details of the caller to determine the requester. You can’t set this directly in the API. However, you could use the clientMetadata object in the body to create a custom attribute to track who the real requester is. For example:
POST https://{tenant}.api.identitynow.com/v3/access-requests
When you go to look up the status of the request using the account activities endpoint, you can find your custom attributes in the clientMetadata property in the response body.