Re: CF Login using configure.json file - never expire ?


Koper, Dies <diesk@...>
 

Hi Vinod,

Your access and refresh tokens are stored in config.json.
Tokens are issued by UAA, there’s nothing you can do in config.json to prevent them from expiring.

The cf CLI does however, since the latest release, support a way to specify a custom client id and secret, and configure those with your refresh token.
You can associate a client id with tokens that have a very long expiry date.
Check out the instructions here: https://github.com/cloudfoundry/cli/issues/919#issuecomment-268699211.
One use case for this is to use that in a CI environment, instead of hard-coding your username and password in a script.

Regards,
Dies Koper
Cloud Foundry Product Manager - CLI


From: Vinod Singh [mailto:vinoddandy(a)gmail.com]
Sent: Sunday, January 01, 2017 7:43 PM
To: Discussions about Cloud Foundry projects and the system overall.
Subject: [cf-dev] CF Login using configure.json file - never expire ?

Hi,
After successful login to Cloud Foundry, all credentials with org/space details are stored in user's home directory/.cf/configure.json file.
Question - Is it possible to update this congigure.json file manually so that my login to cloud foundry never expire ? I know it does not sound reasonable from security perspective but I would like to do it from from my Mac machine.
Currently everytime I have to run this script to login:
cf api https://api.mycf.com
cf login -u vks(a)xxx.com<mailto:vks(a)xxx.com> -p xxxxx -o Org -s Space
Any pointer please.
Regards,
Vinod

Join cf-dev@lists.cloudfoundry.org to automatically receive all group messages.