cloudfoundry / cf-uaac

Apache License 2.0
41 stars 29 forks source link

Is there an easy way to get a client token into a script (and save grep and cuts) #47

Closed haydonryan closed 6 years ago

haydonryan commented 6 years ago

Just wondering if there is a better way to return the token (or an improvement that could be made to the cli to make this easie )

uaac target $URL/uaa --skip-ssl-validation
uaac token owner get opsman user -s "" -p password
apitoken=`uaac contexts | grep access_token | cut -d ':' -f  2 | cut -d ' ' -f 2` 

Thanks :)

cf-gitbot commented 6 years ago

We have created an issue in Pivotal Tracker to manage this:

https://www.pivotaltracker.com/story/show/153820610

The labels on this github issue will be updated when the story is started.

jhamon commented 6 years ago

I'm going to save this snippet for my own use. The problem of ridiculous output formats from uaac is well known. 🙈

We have an experimental cli rewrite in progress that aims to output standard json that you could slice and dice with jq or other tools, but it's not yet at feature parity with the UAA so we haven't made any official releases of it.