Initialize the API using the provided access token.
@param token The access token to use for initialization.
19528
public User initialize(String token) throws WorkspaceApiException {
        return initialize(null, null, null, token);
    }
425449
public void setApi(String api) {
        api = api.trim();
        if ("liberty".equalsIgnoreCase(api)) {
            this.api = "liberty";
        } else if ("websphere".equalsIgnoreCase(api)) {
            this.api = "tr";
        } else if ("tr".equalsIgnoreCase(api)) {
            this.api = "tr";
        } else if ("jsr47".equalsIgnoreCase(api)) {
            this.api = "java-logging";
        } else if ("java".equalsIgnoreCase(api)) {
            this.api = "java-logging";
        } else if ("java.logging".equalsIgnoreCase(api)) {
            this.api = "java-logging";
        } else if ("java-logging".equalsIgnoreCase(api)) {
            this.api = "java-logging";
        } else {
            log("Invalid trace type " + api, Project.MSG_ERR);
        }
    }
38572
public static final void signAuthToken(AuthToken token) {
        String signature = generateSignature(token);
        token.setSignature(signature);
    }
562642
public function setAccessToken($token)
    {
        if (!$this->oauthResponse instanceof InstagramOAuth) {
            $this->oauthResponse = new InstagramOAuth(json_decode(json_encode(['access_token' => $token])));
        }
    }
147442
public void addToken(Token token)
    {
        // Add verification of no token overlap
        if (!token.getSentence().equals(this))
            throw new IllegalArgumentException();
        tokens.add(token);
    }
1137484
function(token) {
        this.oauthClient.setCredentials(token);
        this.brain.set(this.TOKEN_KEY, token.access_token);
        if (token.refresh_token) {
            this.brain.set(this.REFRESH_KEY, token.refresh_token);
        }
        this.brain.set(this.EXPIRY_KEY, +token.expiry_date);
        this.brain.save();
        this.brain.resetSaveInterval(60);
    }
446334
public void setAuthMethod(String method)
    {
        if (isStarted() && _authMethod!=null && !_authMethod.equals(method))
            throw new IllegalStateException("Handler started");
        _authMethod = method;
    }
1259957
public void updateNormalToken(Token token, InetAddress endpoint)
    {
        updateNormalTokens(Collections.singleton(token), endpoint);
    }
553716
public void initialize() throws ODataUnmarshallingException {
        LOG.info("Parser is initializing");
        try {
            JsonParser jsonParser = JSON_FACTORY.createParser(inputJson);

            while (jsonParser.nextToken() != JsonToken.END_OBJECT) {
                String token = jsonParser.getCurrentName();
                if (token != null) {
                    if (token.startsWith(ODATA)) {
                        processSpecialTags(jsonParser);
                    } else if (token.endsWith(ODATA_BIND)) {
                        processLinks(jsonParser);
                    } else {
                        process(jsonParser);
                    }
                }
            }
        } catch (IOException e) {
            throw new ODataUnmarshallingException("It is unable to unmarshall", e);
        }
    }
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);
    }
  }
196158
public void disableOAuth1AccessToken(DbxOAuth1AccessToken token)
        throws DbxException
    {
        if (token == null) throw new IllegalArgumentException("'token' can't be null");
        DbxRequestUtil.doPostNoAuth(
            requestConfig,
            DbxClientV1.USER_AGENT_ID,
            appInfo.getHost().getApi(),
            "1/disable_access_token",
            null,
            getHeaders(token),
            new DbxRequestUtil.ResponseHandler<Void>() {
                @Override
                public Void handle(HttpRequestor.Response response) throws DbxException {
                    if (response.getStatusCode() != 200) throw DbxRequestUtil.unexpectedStatus(response);
                    return null;
                }
            }
        );
    }
228145
public void setTokens(final String tokens) {
        if (tokens != null)
            attrMixin.setAttribute(TOKENS, tokens);
        else
            attrMixin.removeAttribute(TOKENS);
    }
961818
public synchronized void refreshToken()
	{
		final String refreshToken = this.response.refresh_token;

		this.response = null;
		this.cachedInfo = null;

		final String responseStr = authService.getToken(UserManagerOAuthService.GRANT_TYPE_REFRESH_TOKEN,
		                                                null,
		                                                null,
		                                                clientId,
		                                                clientSecret,
		                                                refreshToken,
		                                                null,
		                                                null,
		                                                null);

		loadAuthResponse(responseStr);
	}
934133
public void init(String url, String user, String pass) {
		init(url, user, pass, null);
	}
11079
@SuppressWarnings("unused")
    public static void changeCredentials(String accountID, String token) {
        changeCredentials(accountID, token, null);
    }
753359
public void init(String username, Credentials credentials) {
        this.credentials = credentials;
        setIdentifier(username.toLowerCase());
    }
1355293
public static void init(final String username, final String password, final String accountSid) {
        Twilio.setUsername(username);
        Twilio.setPassword(password);
        Twilio.setAccountSid(accountSid);
    }