dist/corbel.with-polyfills.js
function(refreshToken, scopes) {
                // console.log('iamInterface.token.refresh', refreshToken);
                // we need refresh token to refresh access token
                corbel.validate.isValue(refreshToken, 'Refresh access token request must contains refresh token');
                // we need create default claims to refresh access token
                var params = {
                    claims: {
                        'scope': scopes,
                        'refresh_token': refreshToken
                    }
                };
                var that = this;

                try {
                    return this._doPostTokenRequest(this.uri, params)
                        .then(function(response) {
                            that.driver.config.set(corbel.Iam.IAM_TOKEN, response.data);
                            return response;
                        });
                } catch (e) {
                    console.log('error', e);
                    return Promise.reject(e);
                }
            }
function(refreshToken, scopes) {
                // console.log('iamInterface.token.refresh', refreshToken);
                // we need refresh token to refresh access token
                corbel.validate.isValue(refreshToken, 'Refresh access token request must contains refresh token');
                // we need create default claims to refresh access token
                var params = {
                    claims: {
                        'scope': scopes,
                        'refresh_token': refreshToken
                    }
                };
                var that = this;

                try {
                    return this._doPostTokenRequest(this.uri, params)
                        .then(function(response) {
                            that.driver.config.set(corbel.Iam.IAM_TOKEN, response.data);
                            return response;
                        });
                } catch (e) {
                    console.log('error', e);
                    return Promise.reject(e);
                }
            }
function ( refreshToken , scopes ) { // console.log('iamInterface.token.refresh', refreshToken); // we need refresh token to refresh access token corbel . validate . isValue ( refreshToken , 'Refresh access token request must contains refresh token' ) ; // we need create default claims to refresh access token var params = { claims : { 'scope' : scopes , 'refresh_token' : refreshToken } } ; var that = this ; try { return this . _doPostTokenRequest ( this . uri , params ) . then ( function ( response ) { that . driver . config . set ( corbel . Iam . IAM_TOKEN , response . data ) ; return response ; } ) ; } catch ( e ) { console . log ( 'error' , e ) ; return Promise . reject ( e ) ; } }
Refresh a token to connect with iam
@method
@memberOf corbel.Iam.TokenBuilder
@param {String} [refresh_token]   Token to refresh an AccessToken
@param {String} [scopes]          Scopes to the AccessToken
@return {Promise}                 Q promise that resolves to an AccesToken {Object} or rejects with a {@link corbelError}
Refresh a token to connect with iam