Re: How to execute multiple CF REST methods with an unique authentication


Juan Antonio BreƱa Moral <bren at juanantonio.info...>
 

Hi,

you had reason. I stored in the right way the token, and Now it is possible to reuse a token for multiple operations.

Example:

it.only("Using An unique Login, it is possible to execute 3 REST operations", function () {
this.timeout(2500);

CloudFoundry.setEndPoint(endPoint);

var token_endpoint = null;
var refresh_token = null;
var token_type = null;
var access_token = null;
return CloudFoundry.getInfo().then(function (result) {
token_endpoint = result.token_endpoint;
return CloudFoundry.login(token_endpoint, username, password);
}).then(function (result) {
token_type = result.token_type;
access_token = result.access_token;
return CloudFoundryApps.getApps(token_type, access_token);
}).then(function (result) {
return CloudFoundryApps.getApps(token_type, access_token);
}).then(function (result) {
return CloudFoundryApps.getApps(token_type, access_token);
}).then(function (result) {
expect(true).to.equal(true);
});
});

What is the usage of token_refresh?
How to check the pending time for current token?

Juan Antonio

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