Incorrect Token URL when setting up Ansible Spoke along with AWX tower

Garret1
Tera Expert

I am attempting to set up my Ansible Spoke (Connected to AWX Ansible Tower) in ServiceNow using the instructions found at: https://docs.servicenow.com/bundle/orlando-servicenow-platform/page/administer/integrationhub-store-...

The error comes when I try to get the OAuth Token where the window will first ask for my login info into the tower and then once I am logged in and I authorize the ServiceNow Application, it displays this: 

find_real_file.png

 

I am following the token URL template found in the instructions, https://<Ansible-Tower-Instance>.com/api/o/token/ with my tower instance replace what is found within the <>. Is there any insight why this is not working or where I could find the correct Token URL?

 

Thanks.

 

 

1 ACCEPTED SOLUTION

After working with this a few times, the issue will arise with OAuth when your endpoints cannot communicate due to security/network issues. ServiceNow is public facing while your ansible tower is most likely not. Mid-servers cannot be used to authenticate OAuth 2.0, as stated here: https://docs.servicenow.com/bundle/paris-application-development/page/integrate/outbound-rest/concept/c_OutboundRESTAuth.html

If you cannot loosen security between the two, then I would suggest using basic authentication, which you can find instructions for here: https://docs.servicenow.com/bundle/quebec-servicenow-platform/page/administer/integrationhub-store-spokes/task/setup-ansible.html#setup-ansible

This will allow you to use a mid-server and the credentials for a tower service account to connect tower to your instance. Hope that helps

View solution in original post

9 REPLIES 9

Ashutosh Munot1
Kilo Patron
Kilo Patron

Hi,

When you configure the oAuth profile in there the token url is mentioned. Check that once.

Thanks,
Ashutosh

In ServiceNow or AWX?

Achu1
Mega Expert

Hello @Garret 

 

I am having the same issue with ANsible spoke and it shows Incorrect Token Url. Did you resolve the issue? Please help me to fix the issue if you have any ideas or solutions.

 

Thanks,

Achu

Make sure that your tower has the ServiceNow instance IP addresses whitelisted and maybe even whitelist the machine you are using, this is what worked for us. You may also need to loosen your security restrictions in your instance by using the instructions found here

Hope that helps, know how frustrating it is