# issue am fighting with

**URL:** <https://forum.ansible.com/t/issue-am-fighting-with/24813>\
**Category:** Ansible Project\
**Created:** [June 23, 2017, 4:39pm UTC](https://forum.ansible.com/t/issue-am-fighting-with/24813 "2017-06-23T16:39:26Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ram\_Raj](https://avatars.discourse-cdn.com/v4/letter/r/8edcca/32.png) [@Ram\_Raj](https://forum.ansible.com/u/Ram_Raj)\
**Post date:** [June 23, 2017, 4:39pm UTC](https://forum.ansible.com/t/issue-am-fighting-with/24813/1 "2017-06-23T16:39:26Z")

</div>

# Get Token

# 

- name: “Get Token for {{ wwwurl }}”

hosts: all

connection: local

tasks:

- name: “Post to /mga/sps/oauth20/token”

uri:

url: “{{ wwwurl }}/mga/sps/oauth/oauth20/token”

method: POST

user: “\*\*\*\*\*\*”

password: “\*\*\*\*\*\*”

body: “client\_id=mobile\_client&grant\_type=password&rememberDevice=N”

force\_basic\_auth: yes

output

PLAY [Get Token for [https://mobile-api](https://mobile-api).\*\*\*\*\*.com] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

TASK [Gathering Facts] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

ok: [mobile-api.\*\*\*\*\*.com]]

TASK [Post to /mga/sps/oauth20/token] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

fatal: mobile-api._**.com]]: FAILED! =\> {“cache\_control”: “no-store, no-cache=set-cookie”, “changed”: false, “connection”: “close”, “content”: "{"error":"mapping\_error","error\_description":"No username\/**__ **."}", “content\_language”: “en-US”, “content\_type”: “application/json;charset=UTF-8”, “date”: “Fri, 23 Jun 2017 16:25:03 GMT”, “expires”: “Thu, 01 Dec 1994 16:00:00 GMT”, “failed”: true, “json”: {“error”: “mapping\_error”, “error\_description”: "No username/** _\*\*\*\*\*."}, “msg”: “Status code was not [200]: HTTP Error 400: Bad Request”, “p3p”: “CP="NON CUR OTPi OUR NOR UNI"”, “pragma”: “no-cache”, “redirected”: false, “session\_timeout”: “0”, “set\_cookie”: “AMWEBJCT!%2Fmga!JSESSIONID=00003D9MH5B2YadZ4qTRenXJAJF:8ae44baf-46b7-4705-9c97-50e1231add00; Path=/; HttpOnly, PD\_STATEFUL\_d70a9cb6-5060-11e6-b1dd-005056be1e86=%2Fmga; Path=/”, “status”: 400, “url”: “[https://a-mobile-api.cigna.com/mga/sps/oauth/oauth20/token](https://a-mobile-api.cigna.com/mga/sps/oauth/oauth20/token)”}

Any thing wrong with my request / Playbook?

Thanks,

Ram
