UAA - Non-Browser Requests Code: GET /oauth/authorize, and sample login application


Yogesh Sajanikar
 

I have setup uaa service, and trying to setup a non-browser client (another server actually) to get the authorization. In fact, I am trying to adapt sample "login" application to my needs.

However, the step mentioned in documentation to login fails with "403". Here is the curl command that I am trying.

curl -v -H "Accept:application/json" http://localhost:8080/uaa/login.do -d "username=marissa&password=koala" --cookie cookies.txt --cookie-jar cookies.txt

And here is the response that I get.

* Trying ::1...
* Connected to localhost (::1) port 8080 (#0)
POST /uaa/login.do HTTP/1.1
Host: localhost:8080
User-Agent: curl/7.43.0
Cookie: JSESSIONID=0003A0F5BC783B536970393F2F0B0AE4; X-Uaa-Csrf=RsrCTu
Accept:application/json
Content-Length: 31
Content-Type: application/x-www-form-urlencoded
* upload completely sent off: 31 out of 31 bytes
< HTTP/1.1 403 Forbidden
< Server: Apache-Coyote/1.1
< Strict-Transport-Security: max-age=31536000
< Cache-Control: no-cache, no-store, max-age=0, must-revalidate
< Pragma: no-cache
< Expires: 0
< X-XSS-Protection: 1; mode=block
< X-Frame-Options: DENY
< X-Content-Type-Options: nosniff
< Cache-Control: no-store
< Content-Type: application/json;charset=UTF-8
< Content-Language: en-US
< Transfer-Encoding: chunked
< Date: Thu, 04 Feb 2016 04:30:43 GMT
<
* Connection #0 to host localhost left intact
{"app":{"version":"3.0.1"},"links":{"uaa":"http://localhost:8080/uaa","passwd":"/forgot_password","login":"http://localhost:8080/uaa","register":"/create_account"},"zone_name":"uaa","entityID":"cloudfoundry-saml-login","commit_id":"4f37e9b","idpDefinitions":{},"prompts":{"username":["text","Email"],"password":["password","Password"]},"timestamp":"2016-01-26T01:13:19+0530"}

The sample application "login" does not work in a similar way!