Click HERE to see how Saviynt Intelligence is transforming the industry. |
08/07/2024 01:40 AM
We are currently attempting to raise a request using the createrequestAPI in EIC 24.4, but we are encountering a 401 error. Other APIs such as getuserapi and addroleapi are working correctly. Additionally, when performing the same action via the UI for the same user acting as the requestor, the request is successfully created.
Could you please help me on this.
Regards,
Manohar
08/07/2024 02:00 AM
HI @Manohar_122 ,
Looks like user whose token you are using for authorization doesn't have SAV role assigned having appropriate permissions to execute createrequest API.
Assigne ROLE_ADMIN SAV role to user and then generate token and try to execute API.
08/07/2024 03:24 AM
Hi @pmahalle
Thanks for your reply. We are testing this out with the ROLE_ADMIN SAV role itself but its not working.
Thanks
Manohar
08/07/2024 03:39 AM
Hi @Manohar_122
Then check if role which you are trying to request is requestable or not and requestor you are using in your request payload have appropriate sav role with request permissions.
08/07/2024 03:50 AM
Hi @pmahalle
Yes the role is requestable and requestor we are using in our request in payload also has the ROLE_ADMIN Sav role.
Regards,
Manohar
08/07/2024 04:58 AM
regenerate the token and validate.
08/07/2024 05:31 AM
Hi @rushikeshvartak
I did try to regenerate token and use it many times but its the same.
Here are the postman screenshot and curl command
curl command
curl --location 'https://{{URL}}/ECM/api/v5/createrequest' \
--header 'SAVUSERNAME: admin' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJwcmluY2lwYWwiOiJINHNJQUFBQUFBQUFBSlZTdjA4VVFSajk5anlDOFJJRUUwMHNvQkU2c3hlNXlsd0RuS2ZCckFmaHVBWVR6ZHp1eHpvd083UE96TUpkUTY3Q2dnS2lrSkR3TFwvQ2ZRR05qWjdTd3BiYjFtK1hIbmpiRXFYYVwvZWZ2ZTk5N2Iwd3NZTVJwcXNXWmNHRDhWV2N5dBS0lBS3krd0hSYW9jallYN2w4dG1sb3RxRzIwOWdMc3BNNGEyKzhkSjI3clYzYjFiVTVLRGo3QUQ1VjdxMGFIc1poelVkengrUXdsQnJybVNacm9qRXhYeGRlN0VpWDh3K2Zuclwvc21nVXd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9MM1F3cU9oMVF0WXZaZlNOaE1GODZwR3BcL3o5ZVBuTDBjV250M2RJMlNGZVwvbjhmMFwvTlh5ZlViS2ttWlpsWU5kVVMwMjJYM1RPUUx0NU5mdDlEMzJ6eEpCZElmSlMxR054SUZNZGt0YXlXdTg3WndiMlVwYUw2ZmZcL0Ztc2VWZUs2dFVaSE94OFd6MmVZMjB4M0xycmpNXC9VTlRZM3ErRDhcLzBuUDRqbk5ZeHNNWkVoSlQ5ZWdGcFowa1c5ZTNvMFdUbjh1WmY3eUtYSHZ0WCtBRUhwdkNrWEF3QUEiLCJpc3MiOiJzc20tZGV2LXBtaS5zYXZpeW50Y2xvdWQuY29tIiwic3ViIjoiVGVzdEVJQzEyOTMiLCJleHAiOjE3MjI5MzMyNzUsImlhdCI6MTcyMjkyOTY3NSwicm9sZXMiOlsiUk9MRV9BRE1JTiJdfQ.FeZ3Pb4L9tuf5gi9tFqHmigVGTGe0r9lXqDJedOEiqE; token_type=Bearer; user_name=TestEIC1293' \
--data '{
"accesstype":"ROLES",
"username":"1000676802",
"roletype":"ENTERPRISE",
"requesttype":1,
"roles":[
{
"rolename" : "TEST VIVA ROLE 3",
"startdate" : "08-06-2024",
"enddate" : "10-06-2024",
"businessJustification" : "testjustification"
} ],
"requestcomments":"commemnt",
"requestor":"1000676802"
}'
Regards
Manohar
08/07/2024 06:12 AM
@Manohar_122 Hope you are passing the username of requestor in payload
"requestor":"1000676802"
08/07/2024 09:31 PM
Hi @SumathiSomala
Yes we are passing the username of requestor in payload
Regards,
Manohar
08/07/2024 06:31 PM
Try with user having sav role as role_admin
08/07/2024 09:32 PM
@rushikeshvartak We are using the role_admin sav role itself.
08/07/2024 10:58 PM
Hi @Manohar_122 this looks to be a defect for me. I would recommend you to open a ticket with Saviynt support for further troubleshooting.
08/08/2024 06:48 AM
Its working for me in v24.7 & 24.4
validate your subversion
08/08/2024 07:01 AM
Its not working for me on v24.4
08/08/2024 07:28 AM
Whats your subversion
08/11/2024 11:13 PM
This is working when i disable the OAuth and not working when its enabled
08/12/2024 05:29 AM
08/12/2024 06:00 AM
I am using normal access token
08/12/2024 06:01 AM
Then ouath can be kept as untick
08/12/2024 06:11 AM
What should i use if i need to keep the ouath as enabled and not disabled? because i want the ouath as enabled and also other api request like getuser and addrole api are working fine when the ouath is enabled and using the access token
08/12/2024 06:12 AM
Use refresh token api from postman package
08/12/2024 06:27 AM
No Its giving 401 error if i try to use the the refresh token with the oauth enabled
08/12/2024 06:29 AM
Use token from UI under web service auth
08/12/2024 06:39 AM
Its not working even when using the token from UI under web service auth
08/12/2024 06:40 AM
Share curl
Please share postman screenshot and curl command [Refer https://codingnconcepts.com/postman/how-to-generate-curl-command-from-postman/ ]
⚠️‼️‼️Do not upload any attachments that contain sensitive information, such as IP Addresses, URLs, Company/Employee Names, Email Addresses, etc.‼️‼️⚠️
08/12/2024 06:53 AM
Curl command response
curl --location 'https://{URL}/ECM/api/v5/createrequest' \
--header 'SAVUSERNAME: admin' \
--header 'Content-Type: application/json' \
--header 'grant_type: refresh_token' \
--header 'refresh_token: yJhbGciOiJIUzI1NiJ9.eyJwcmluY2lwYWwiOiJINHNJQUFBQUFBQUFBSlZTUDA4VVFSUlwvZXh5QlNJSkFJZ2tGTm1KbjlrNUkwT1FhQWRGQTFqdkRlUTBtbXJuZHh6SXdPN1BNek1KZFE2NlNnZ0tEa3BqNEZlajlFTnI0QVlnV3R0UzJ2bG4rN0dsRG5HcjN6VzlcL1wvZldvVGUxemVcLzcrWkZlNkdGeVQ3ckJheldTY25OZU1IOFNxTlRQdnYwOHNQSitjSHJBVkoyaUdmXC92NCtaaGN2bXVrc3FTWmxtVnZYdGlHajN5dTZaeUJkdkpyXC9hUXRkdjhpUVZTSCtVdEJoZFN4VEVGTGVzbGJqcTI4S3R0VWF3XC9IYmg2WXVWZXY3NnNGcXR6aithZjF5ZEplblJQTGxibVI4b1d0amhyXC9mZmp1NzlJSnBWR054bElrTXFmcXdBMWJPa2pmcmQ2Y24weU1lZmgzbU1YSG4wUytNUHdrXC9cL2FCWURBQUE9Iiwic3ViIjoiMTAwMDY3NjgwMiIsImlhdCI6MTcyMzQ3MDY5NSwicm9sZXMiOlsiUk9MRV9BRE1JTiJdfQ.YRNiVd2lTWStvCd3lysQnocIxDUmwD2gn5PZcPYeJJI' \
--header 'Cookie: JSESSIONID=DB50441F075DED033F5E7A09FC1FC4AB; CCSRF-TOKEN=fef76784-09d5-4972-ad49-e4a3dd609c5a; INGRESSCOOKIE=1723442602.786.187.63802|0f4091fceac04271d9e9e5a60a3d3e8f; MS_REDIRECT_URL=https%3A%2F%2F{URL}%2FECM%2Foauth%2Ftoken; access_token=eyJhbGciOiJIUzI1NiJ9.eyJwcmluY2lwYWwiOiJINHNJQUFBQUFBQUFBSlZTdjA4VVFSajk5anlDOFJJRUUwMHNvQkU2c3hlNXlsd0RuS2ZCckFmaHVBWVR6ZHp1eHpvd083UE96TUpkUTY3Q2dnS2lrSkR3TFwvQ2ZRR05qWjdTd3BiYjFtK1hIbmpiRXFYNZGt0YXlXdTg3WndiMlVwYUw2ZmZcL0Ztc2VWZUs2dFVaSE94OFd6MmVZMjB4M0xycmpNXC9VTlRZM3ErRDhcLzBuUDRqbk5ZeHNNWkVoSlQ5ZWdGcFowa1c5ZTNvMFdUbjh1WmY3eUtYSHZ0WCtBRUhwdkNrWEF3QUEiLCJpc3MiOiJzc20tZGV2LXBtaS5zYXZpeW50Y2xvdWQuY29tIiwic3ViIjoiVGVzdEVJQzEyOTMiLCJleHAiOjE3MjM0NzIxMzcsImlhdCI6MTcyMzQ2ODUzNywicm9sZXMiOlsiUk9MRV9BRE1JTiJdfQ.V6akbLC58t_17anhRfp5knTXwPDmcsffqR249F-4Pgk; token_type=Bearer; user_name=TestEIC1293' \
--data '{
"accesstype":"ROLES",
"username":"TestEIC1293",
"roletype":"ENTERPRISE",
"requesttype":1,
"roles":[
{
"rolename" : "Test_Role_deleted",
"startdate" : "08-12-2024",
"enddate" : "10-06-2024",
"businessJustification" : "testjustification"
} ],
"requestcomments":"commemnt",
"requestor":"TestEIC1293"
}'
08/12/2024 07:02 AM
Validated in v24.4 and v24.7 with oauth 2 tick i am able to create request using API