- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-15-2022 12:27 AM
Hi
Background:
We have outbound integration from catalog item to middleware, which is then connected to the 3rd part tool. We have a script include function for the rest message (ie content type, authe, etc). And are using the static token for login credentials. This request and response go through a mid-server. everything was working fine until now.
They removed the middleware and developed the new API for catalog item and the 3rd part tool, gave us the new endpoint for testing, and gave the new encrypted user and password (earlier we were using the token for auth).
Questions:
I started testing with a new endpoint and encrypted credentials. Update the script with username and password as shown below.
rest.setBasicAuth("username", "encrypted password");
Note: encrypted password is a very lengthy one
While testing, I always get a response code 401 (Method failed: ...../xyz/proxy/ Invalid username/password combo), but when I ask them about this error, they tell me the username and password are right, and it's verified and tested. I don't what the issue is. I am not able to figure it out.
What might be the problem:
Is it the mid-server?
Is the encrypted password which is lengthy or should it be decrypted?
Please help me with this analysis and resolve the issue.
Thanks
Rahul
Solved! Go to Solution.
- Labels:
-
bidirectional integration

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-15-2022 04:36 AM
Hello @rahulg,
to me it sounds like they already provided you the Base64-encoded username and password.
If thats the case, then you can pass this value directly in the Header via the Authorization parameter.
See the following screenshot and link explaining basic authentication:
https://www.debugbear.com/basic-auth-header-generator
I hope this helped!
Greetings,
Sören

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-15-2022 04:36 AM
Hello @rahulg,
to me it sounds like they already provided you the Base64-encoded username and password.
If thats the case, then you can pass this value directly in the Header via the Authorization parameter.
See the following screenshot and link explaining basic authentication:
https://www.debugbear.com/basic-auth-header-generator
I hope this helped!
Greetings,
Sören
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-15-2022 07:34 AM
Thanks for taking the time to respond to my question.
They did not give me the token or the above-mentioned authorization, but they gave us the username and encrypted password.
Thanks
Rahul
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-15-2022 06:21 AM
Hi @rahulg ,
1. Can you try to give user name password on REST Message Authentication tab?
Create Basic Auth Profile and give user name and password and no need to set on business rule again.
2. The error is 401 may be check with third party team and make sure those credentials are valid and also
try with test payload.
Using Post man.
If you have Sample payload give some dummy values and test on the postman and you can verify response as well.
ServiceNow Community MVP 2024.
Thanks,
Pavankumar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-23-2022 12:02 AM
Hi @rahulg ,
have you checked my response ?
If not try and let me know if need anything or if it resolved accept the solution and hit Thumb icon.
ServiceNow Community MVP 2024.
Thanks,
Pavankumar