- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā04-02-2024 08:02 AM
In ServiceNow Ansible integration, we are using basic authentication. We have set up credential and connection as well as per Servicenow Ansible spoke,
For test purpose we have set all details in Rest Message.
In HTTP method->Get method when I try to test the connection it getting
Method failed: (/api/now/table/sc_req_item) with code: 401 - Invalid username/password combo
But username and password is correct. we can connect to Ansible tower using that credential.
Please assist
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā04-02-2024 08:18 AM - edited ā04-02-2024 08:20 AM
Hello @Madhura Ambede ,
Can you check the user has the role web_service_admin or not?
If you're encountering a 401 error (Unauthorized) when testing the connection to ServiceNow from Ansible Tower using basic authentication, there are a few potential reasons and troubleshooting steps you can take:
1) Verify Username and Password - cross check the username and password configured in the Rest Message in ServiceNow. Ensure there are no typos or extra spaces in the credentials.
2) Check Instance URL - Ensure that the URL configured in the Rest Message matches the URL of your ServiceNow instance exactly, including the protocol (http or https).
3) Verify ServiceNow Instance Settings - Ensure that basic authentication is enabled and configured properly on your ServiceNow instance. Check if there are any IP restrictions or firewall rules blocking the access.
4) Test Authentication with cURL - Use cURL or a similar tool to test basic authentication against the ServiceNow API outside of Ansible Tower. This can help verify if the issue is specific to Ansible Tower or if it's a general authentication issue.
Example cURL command:
curl -X GET -u username:password https://your-instance.service-now.com/api/now/table/sc_req_item
Please Mark My Answer as Helpful and Accept as Solution, if you find this article helpful or resolves your issue.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā04-02-2024 08:18 AM - edited ā04-02-2024 08:20 AM
Hello @Madhura Ambede ,
Can you check the user has the role web_service_admin or not?
If you're encountering a 401 error (Unauthorized) when testing the connection to ServiceNow from Ansible Tower using basic authentication, there are a few potential reasons and troubleshooting steps you can take:
1) Verify Username and Password - cross check the username and password configured in the Rest Message in ServiceNow. Ensure there are no typos or extra spaces in the credentials.
2) Check Instance URL - Ensure that the URL configured in the Rest Message matches the URL of your ServiceNow instance exactly, including the protocol (http or https).
3) Verify ServiceNow Instance Settings - Ensure that basic authentication is enabled and configured properly on your ServiceNow instance. Check if there are any IP restrictions or firewall rules blocking the access.
4) Test Authentication with cURL - Use cURL or a similar tool to test basic authentication against the ServiceNow API outside of Ansible Tower. This can help verify if the issue is specific to Ansible Tower or if it's a general authentication issue.
Example cURL command:
curl -X GET -u username:password https://your-instance.service-now.com/api/now/table/sc_req_item
Please Mark My Answer as Helpful and Accept as Solution, if you find this article helpful or resolves your issue.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā04-06-2024 01:43 AM
Thanks for providing the solution and it works.
But now getting another error.
In HTTP get method : 1) if user mid server then getting The request failed: Request not sent to uri= ENDPOINT URL : org.apache.commons.httpclient.HttpException: Session contains no certificates - Untrusted
AND
2) without using MID server : getting error code 1
please assist
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā04-06-2024 07:50 AM
Hello @Madhura Ambede ,
The error message "Session contains no certificates - Untrusted" suggests that the HTTPS connection from the MID Server to the endpoint URL is encountering certificate validation issues. Here are some steps you can take to address this issue:
- Ensure that the SSL certificate presented by the endpoint URL is valid and trusted by the MID Server.
- Check the certificate chain to ensure that all intermediate certificates are properly installed and configured on the MID Server.
- Verify that the MID Server is configured to trust the SSL certificate presented by the endpoint URL.
Please Mark My Answer Helpful and Accept it as solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā04-10-2024 02:47 AM
Hello @Appanna M ,
Do you have any document for ServiceNow Integration with Ansible using basic auth which contains step by step procedure.
If I am not using mid server, then getting same error.
Please assist