0

I've created a client in my UAA (CloudFoundry v2):

$ uaac client add clienttest --scope testscope --secret mysecret --authorized_grant_types client_credentials
  scope: testscope
  client_id: clienttest
  authorized_grant_types: client_credentials
  id: clienttest

When I subsequently try and get a token for my client (as per Dave Syer's example) I get a 302 redirecting to a login form:

$ curl "http://clienttest:mysecret@uaa.domain.com" -d grant_type=client_credentials -d client_id=clienttest -v
* About to connect() to uaa.domain.com port 80 (#0)
*   Trying 31.210.241.5...
* connected
* Connected to uaa.domain.com (31.210.241.5) port 80 (#0)
* Server auth using Basic with user 'clienttest'
> POST / HTTP/1.1
> Authorization: Basic ZGpvbmVzdGVzdDpteXNlY3JldA==
> User-Agent: curl/7.24.0 (x86_64-apple-darwin12.0) libcurl/7.24.0 OpenSSL/0.9.8x zlib/1.2.5
> Host: uaa.domain.com
> Accept: */*
> Content-Length: 50
> Content-Type: application/x-www-form-urlencoded
> 
* upload completely sent off: 50 out of 50 bytes
< HTTP/1.1 302 Found
< Content-Length: 0
< Date: Wed, 25 Sep 2013 13:49:23 GMT
< Location: http://uaa.domain.com/login;jsessionid=D97804429EF745FBDF02F0F6DA278C66
< Server: Apache-Coyote/1.1
< Set-Cookie: JSESSIONID=D97804429EF745FBDF02F0F6DA278C66; Path=/; HttpOnly
< 
* Connection #0 to host uaa.domain.com left intact
* Closing connection #0

Here's the state of my client:

$ uaac client get clienttest
  scope: testscope
  client_id: clienttest
  resource_ids: none
  authorized_grant_types: client_credentials
  authorities: uaa.none

I've also tried this with our admin user and I get the same 302.

I can get a token successfully using uaac token client get clienttest.

Any ideas what I'm doing wrong?

Charles
  • 50,943
  • 13
  • 104
  • 142
DeejUK
  • 12,891
  • 19
  • 89
  • 169

1 Answers1

0

You are not specifying a specific URL to reach, just "/" so the system just redirects you to a login URL.

you specify http://clienttest:mysecret@uaa.domain.com

but what are you trying to do?