The /info endpoint of the Cloud Controller exposes two URLs for authentication:
AuthorizationEndpoint - this should point to your login page (html web page, configurable by the administrator) but defaults to your UAA URL if you don't set it.
We need to implement the SDK like cf is implemented, which means we need to hook into Thinktecture to always send "accept: application/json" (so that UAA replies correctly).
The
/info
endpoint of the Cloud Controller exposes two URLs for authentication:The login problem when targeting bluemix is that the token endpoint does not behave as other token endpoints from other deployments. I tested with the AuthorizationUrl endpoint and it works. The reason this always works with the cf CLI is that the CLI uses the AuthorizationEndpoint to retrieve the token and makes an assumption (undocumented as far as I can tell) that if you use an "accept" "application/json" header, the server will respond like a token endpoint, and not reply with HTML. See here: https://github.com/cloudfoundry/cli/blob/428bd9d8a76ca6199b67560500b3e5b495cba2db/cf/api/authentication/authentication.go#L118 and here: https://github.com/cloudfoundry/cli/blob/d32d02159a6994163abf27349e0a98bb4dcaaa68/cf/net/gateway.go#L197
We need to implement the SDK like cf is implemented, which means we need to hook into Thinktecture to always send "accept: application/json" (so that UAA replies correctly).