Set the token and authentications for this security context.
<p/>
This method can be overwritten to handle custom policies.

@param token current token
@param authentications authentications for token
972409
@Api
	public void setAuthentications(String token, List<Authentication> authentications) {
		this.token = token;
		this.authentications.clear();
		if (null != authentications) {
			for (Authentication auth : authentications) {
				for (BaseAuthorization ba : auth.getAuthorizations()) {
					if (ba instanceof AuthorizationNeedsWiring) {
						((AuthorizationNeedsWiring) ba).wire(applicationContext);
					}
				}
				this.authentications.add(auth);
			}
		}
		userInfoInit();
	}
394851
public static void setPassword(final String password) {
        if (password == null) {
            throw new AuthenticationException("Password can not be null");
        }

        if (!password.equals(Twilio.password)) {
            Twilio.invalidate();
        }

        Twilio.password = password;
    }
1228217
public void setAuthenticated(final String sessionId, final Principal user) {

		securityContext = SecurityContext.getInstance(user, AccessMode.Backend);
		securityContext.setSessionId(sessionId);

		logger.debug("Session ID of security context " + securityContext + " set to " + sessionId);

		timedOut = false;
	}
689664
public void setSecurityGroups(java.util.Collection<String> securityGroups) {
        if (securityGroups == null) {
            this.securityGroups = null;
            return;
        }

        this.securityGroups = new java.util.ArrayList<String>(securityGroups);
    }
259032
public synchronized void initialiseFromAPIToken(final String token)
	{
		final String responseStr = authService.getToken(UserManagerOAuthService.GRANT_TYPE_TOKEN_EXCHANGE,
		                                                null,
		                                                getOwnCallbackUri().toString(),
		                                                clientId,
		                                                clientSecret,
		                                                null,
		                                                null,
		                                                null,
		                                                token);

		loadAuthResponse(responseStr);
	}
649518
@SuppressWarnings("unchecked") /* See constructor comments. */
  public void setAuthorization(Object soapClient, AdsSession adsSession)
      throws AuthenticationException {
    final String authorizationHeader =
        authorizationHeaderProvider.getAuthorizationHeader(adsSession,
            soapClientHandler.getEndpointAddress(soapClient));
    soapClientHandler.putAllHttpHeaders(soapClient, new HashMap<String, String>() {
      {
        put("Authorization", authorizationHeader);
      }
    });
  }
858836
protected void setCredentials(Subject subject,
                                  String securityName,
                                  String urAuthenticatedId) throws Exception {
//        Principal principal = new WSPrincipal(securityName, accessId, authMethod);
        if (urAuthenticatedId != null && !urAuthenticatedId.equals(securityName)) {
            Hashtable<String, String> subjectHash = new Hashtable<String, String>();
            subjectHash.put(AuthenticationConstants.UR_AUTHENTICATED_USERID_KEY, urAuthenticatedId);
            subject.getPrivateCredentials().add(subjectHash);

        }
        CredentialsService credentialsService = getCredentialsService();
        credentialsService.setCredentials(subject);
    }
713202
public void setAuthMechOid(String authMechOid) {
        if (authMechOid == null || authMechOid.length() == 0) {
            this.authMechOid = this.getdefaultAuthMechOid();
        } else {
            this.authMechOid = authMechOid;
        }
    }
904527
def set_token(self):
        
        super(ServicePrincipalCredentials, self).set_token()
        try:
            token = self._context.acquire_token_with_client_credentials(
                self.resource,
                self.id,
                self.secret
            )
            self.token = self._convert_token(token)
        except adal.AdalError as err:
            raise_with_traceback(AuthenticationError, "", err)
201637
public void setScopes(Set<ApiAppOauthScopeType> scopes) {
        if (oauth == null) {
            oauth = new ApiAppOauth();
        }
        oauth.setScopes(scopes);
    }
906120
public void setAuthentication(HttpURLConnection http) {
		
		if(user == null || pass == null 
				|| user.length() <= 0 || pass.length() <= 0) {
			return;
		}

		String base64login = Base64.encode(user + ":" + pass);

		http.addRequestProperty("Authorization", "Basic " + base64login);
		
	}
877390
public void setMemberAccounts(java.util.Collection<String> memberAccounts) {
        if (memberAccounts == null) {
            this.memberAccounts = null;
            return;
        }

        this.memberAccounts = new java.util.ArrayList<String>(memberAccounts);
    }
1252487
public void setDefaultTokens(final List<HttpSessionToken> tokens) {
		this.defaultTokens = tokens;
		
		saveDefaultTokens();
		this.defaultTokensEnabled = defaultTokens.stream()
				.filter(HttpSessionToken::isEnabled)
				.map(HttpSessionToken::getName)
				.collect(Collectors.toList());
	}
816232
public void setCredential(String username, String password) {
	if (username != null) {
	    env.put("java.naming.security.principal", username);
	    env.put("java.naming.security.credentials", password);
	}
	else {
	    env.remove("java.naming.security.principal");
	    env.remove("java.naming.security.credentials");
	}
    }
397669
public void setIdentities(java.util.Collection<String> identities) {
        if (identities == null) {
            this.identities = null;
            return;
        }

        this.identities = new com.amazonaws.internal.SdkInternalList<String>(identities);
    }
1050316
public void setClusterSecurityGroups(java.util.Collection<ClusterSecurityGroup> clusterSecurityGroups) {
        if (clusterSecurityGroups == null) {
            this.clusterSecurityGroups = null;
            return;
        }

        this.clusterSecurityGroups = new com.amazonaws.internal.SdkInternalList<ClusterSecurityGroup>(clusterSecurityGroups);
    }
931898
@Given("^I( do not)? set sso token using host '(.+?)' with user '(.+?)' and password '(.+?)'( and tenant '(.+?)')?$")
    public void setGoSecSSOCookie(String set, String ssoHost, String userName, String passWord, String foo, String tenant) throws Exception {
        if (set == null) {
            HashMap<String, String> ssoCookies = new GosecSSOUtils(ssoHost, userName, passWord, tenant).ssoTokenGenerator();
            String[] tokenList = {"user", "dcos-acs-auth-cookie"};
            List<com.ning.http.client.cookie.Cookie> cookiesAtributes = addSsoToken(ssoCookies, tokenList);

            commonspec.setCookies(cookiesAtributes);
        }
    }