Adds the Access Token and the associated parameters to the Token Response.
429119
def _add_access_token_to_response(self, response, access_token):
        # type: (oic.message.AccessTokenResponse, se_leg_op.access_token.AccessToken) -> None
        
        response['access_token'] = access_token.value
        response['token_type'] = access_token.type
        response['expires_in'] = access_token.expires_in
353183
def add_params(endpoint, params):
    
    p = PreparedRequest()
    p.prepare(url=endpoint, params=params)
    if PY2:  # pragma: no cover
        return unicode(p.url)
    else:  # pragma: no cover
        return p.url
629916
def add_term(set_id, term, access_token):
    
    api_call('post', 'sets/{}/terms'.format(set_id), term.to_dict(), access_token=access_token)
339287
def auth_add(name, service, **kwargs):
    
    ctx = Context(**kwargs)
    ctx.execute_action('auth:group:members:add', **{
        'storage': ctx.repo.create_secure_service('storage'),
        'name': name,
        'service': service,
    })
996976
def _add_auth_headers(self, base):
        """"""
        if 'access_token' in self.creds:
            return _extend(base, {
                'authorization': 'Bearer ' + self.creds['access_token']
            })
        return base
878728
@Override
    public SignUpRequest addAuthenticationParameters(Map<String, Object> parameters) {
        authenticationRequest.addAuthenticationParameters(parameters);
        return this;
    }
752833
def _http_response(self, url, method, data=None, content_type=None,
                       schema=None, **kwargs):
        

        if schema is None:
            schema = self.schema_2

        header = {
            'content-type': content_type or 'application/json',
            'Accept': schema,
        }

        # Token specific part. We add the token in the header if necessary
        auth = self.auth
        token_required = auth.token_required
        token = auth.token
        desired_scope = auth.desired_scope
        scope = auth.scope

        if token_required:
            if not token or desired_scope != scope:
                logger.debug("Getting new token for scope: %s", desired_scope)
                auth.get_new_token()

            header['Authorization'] = 'Bearer %s' % self.auth.token

        if data and not content_type:
            data = json.dumps(data)

        path = url.format(**kwargs)
        logger.debug("%s %s", method.__name__.upper(), path)
        response = method(self.host + path,
                          data=data, headers=header, **self.method_kwargs)
        logger.debug("%s %s", response.status_code, response.reason)
        response.raise_for_status()

        return response
230876
@Override
  public void addTokens(final byte[] tokens) {

    try (final DataInputBuffer buf = new DataInputBuffer()) {

      buf.reset(tokens, tokens.length);
      final Credentials credentials = new Credentials();
      credentials.readTokenStorageStream(buf);

      final UserGroupInformation ugi = UserGroupInformation.getCurrentUser();
      ugi.addCredentials(credentials);
      LOG.log(Level.FINEST, "Added {0} tokens for user {1}", new Object[] {credentials.numberOfTokens(), ugi});

    } catch (final IOException ex) {
      LOG.log(Level.SEVERE, "Could not access tokens in user credentials.", ex);
      throw new RuntimeException(ex);
    }
  }
1068034
public void setoAuthAccessToken(OAuthAccessToken oAuthAccessToken) {
    this.oAuthAccessToken = oAuthAccessToken;
    this.accessToken = new Token(oAuthAccessToken.getOauthToken(), oAuthAccessToken.getOauthTokenSecret());
  }
877922
def add_tokens_for_pass(self):
        """"""
        # Make sure pass not added to group again
        self.groups.empty = False

        # Remove existing newline/indentation
        while self.result[-1][0] in (INDENT, NEWLINE):
            self.result.pop()

        # Add pass and indentation
        self.add_tokens(
            [ (NAME, 'pass')
            , (NEWLINE, '\n')
            , (INDENT, self.indent_type * self.current.scol)
            ]
        )
486008
public TokenOrListParam add(String theSystem, String theValue) {
		add(new TokenParam(theSystem, theValue));
		return this;
	}
669404
public function addToken(Token $token)
    {
        $response = $this
            ->httpClient
            ->get(
                sprintf('/%s/tokens', $this->getAppUUID()->getId()),
                'put',
                [],
                $token->toArray(),
                Http::getApisearchHeaders($this)
            );

        self::throwTransportableExceptionIfNeeded($response);
    }
638541
private void addParams(RequestBuilder call, Param[] params) {
		
		// Once upon a time this was necessary, now it isn't
		//call.addParam("format", "json");
		
		if (this.accessToken != null)
			call.addParam("access_token", this.accessToken);

		if (this.appSecretProof != null)
			call.addParam("appsecret_proof", this.appSecretProof);

		if (params != null) {
			for (Param param: params) {
				if (param instanceof BinaryParam) {
					call.addParam(param.name, (InputStream)param.value, ((BinaryParam)param).contentType, "irrelevant");
				} else {
					String paramValue = StringUtils.stringifyValue(param, this.mapper);
					call.addParam(param.name, paramValue);
				}
			}
		}
	}
1278070
private HashMap<String, String> createAuthorizationParams() {

        HashMap<String, String> params = new HashMap<>(3);
        params.put("response_type", "code");
        params.put("client_id", preferences.clientId.get());
        params.put("redirect_uri", HTTP_LOCALHOST);

        return params;
    }
814857
def access_token(self):

        '''  '''

        title = '%s.access_token' % self.__class__.__name__
    
    # import dependencies
        from time import time
        import requests

    # construct request kwargs
        request_kwargs = {
            'url': self.token_endpoint,
            'data': {
                'client_id': self.client_id,
                'client_secret': self.client_secret,
                'grant_type': 'client_credentials'
            }
        }

    # send request
        try:
            current_time = time()
            response = requests.post(**request_kwargs)
        except Exception:
            if self.requests_handler:
                request_kwargs['method'] = 'POST'
                request_object = requests.Request(**request_kwargs)
                return self.requests_handler(request_object)
            else:
                raise

        response_details = self.response_handler.handle(response)

        if response_details['json']:
            self._access_token = response_details['json']['access_token']
            expires_in = response_details['json']['expires_in']
            self.expires_at = current_time + expires_in
            
        return self._access_token
47746
def add(self, auth, method, args, notimeout=False):
        """"""
        authstr = self._authstr(auth)
        self._requests.setdefault(authstr, []).append((method, args))
        self._notimeouts.setdefault(authstr, False)
        if notimeout:
            self._notimeouts[authstr] = notimeout
272655
function RobinApi (accessToken, coreUrl, placesUrl) {
    if (accessToken) {
      RobinApi.super_.apply(this, arguments);
      this.setAccessToken(accessToken);
      this.setupCore(coreUrl);
      this.setupPlaces(placesUrl);
      this.loadApiModules();
    } else {
      throw new TypeError('The access token is missing or malformed');
    }
  }