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

Thank you very much for quick response. I will try that out. It was helpful

 

Thank you

 

Achu

 

 

@Garret I asked our Cloud team to make the above changes but they are do not want to expose our ansible to external. that brings us to the cross roads again to solve the issue as I unable to find any other solution from ServiceNow side too.

 

Is there any other way to make it work? Please let me know.

 

Thanks,

Achu

blairf
Giga Expert

We have the same error.  Any resolution?

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

Hi Garret;

As per the doc link you mentioned above, I have set up ansible ac using basic authentication and configured the mid-server connectivity. 

How to test the connectivity from ServiceNow to ansible through REST outbound.  What needs to select in the REST outbound Aunthtication tab? like Authentication Type, Basic auth profile, etc?

 

Thanks

Balaji Prusty