Track trusted multifactor authentication attribute.

@param authn         the authn
@param attributeName the attribute name
12698
public static void trackTrustedMultifactorAuthenticationAttribute(
        final Authentication authn,
        final String attributeName) {

        val newAuthn = DefaultAuthenticationBuilder.newInstance(authn)
            .addAttribute(attributeName, Boolean.TRUE)
            .build();
        LOGGER.debug("Updated authentication session to remember trusted multifactor record via [{}]", attributeName);
        authn.update(newAuthn);
    }
1262320
public static void setCurrentAuthentication(Authentication authentication) {
        RequestContext context = RequestContext.getCurrent();
        if (context != null) {
            setAuthentication(context.getRequest(), authentication);
        }
    }
120317
public String getAttribute(String attributeName) {
		if (attributeName != null){
			return this.attributes.get(attributeName);
		}
		
		return null;
	}
839167
public static AuthInfo parseAuth(String authString) {
        String[] authComponents = getComponents(authString, "authString", "scheme:authString");
        return new AuthInfo(authComponents[0], authComponents[1].getBytes(Charsets.UTF_8));
    }
1643
def __set_revlookup_auth_string(self, username, password):
        '''
        
        '''
        auth = b2handle.utilhandle.create_authentication_string(username, password)
        self.__revlookup_auth_string = auth
991277
def _trig_auth_check(self, useriden):
        '''  '''
        if not self.user.admin and useriden != self.user.iden:
            raise s_exc.AuthDeny(user=self.user.name, mesg='As non-admin, may only manipulate triggers created by you')
374631
public void setAuthenticationToken(Authentication authentication) {
        if( logger.isDebugEnabled() ) {
            logger.debug( "New authentication token: " + authentication );
        }

        final HttpInvokerRequestExecutor hire = getHttpInvokerRequestExecutor();
        if( hire instanceof BasicAuthHttpInvokerRequestExecutor ) {
            if( logger.isDebugEnabled() ) {
                logger.debug( "Pass it along to executor" );
            }
            ((BasicAuthHttpInvokerRequestExecutor) hire).setAuthenticationToken( authentication );
        }
    }
524280
public <T> T getAuthenticationAttribute(final String name, final Class<T> clazz)
    {
        final Object attribute = getAuthenticationAttribute(name);
        return getAttributeByType(name, clazz, attribute);
    }
209347
protected final boolean isAuthenticated(Context context) {
        Account account = context.getSession(AuthConstants.ACCOUNT_ATTRIBUTE);
        if (account == null) {
            account = context.getLocal(AuthConstants.ACCOUNT_ATTRIBUTE);
        }
        return account != null && account.isAuthenticated();
    }
509043
public static String validateAttributeNames(
      Enumeration<String> attributeNames) {
    while (attributeNames.hasMoreElements()) {
      String attribute = attributeNames.nextElement();
      if (!attribute.equals("users") && !attribute.equals("poolGroups") &&
          !attribute.equals("poolInfos") && !attribute.equals("toKillSessionId")
          && !attribute.equals("killSessionsToken")) {
        return 
          "Illegal parameter " + attribute + ", only 'users, " +
          "poolGroups, 'poolInfos', 'toKillSessionId' and 'killSessionsToken'" +
          "parameters allowed.";
      }
    }
    return null;
  }
1161769
public void setAttribute(String attrname, String value) {
        if (attributes == null)
            attributes = new ArrayList<Attribute>();
        Attribute.setAttribute(attributes, attrname, value);
    }
1125738
public int authenticate(AuthenticationClient auth, String servicename)
			throws SshException {
		try {
			auth.authenticate(this, servicename);
			readMessage();
			transport
					.disconnect(TransportProtocol.PROTOCOL_ERROR,
							"Unexpected response received from Authentication Protocol");
			throw new SshException(
					"Unexpected response received from Authentication Protocol",
					SshException.PROTOCOL_VIOLATION);
		} catch (AuthenticationResult result) {
			state = result.getResult();
			if (state == SshAuthentication.COMPLETE)
				transport.completedAuthentication();
			return state;
		}
	}
949346
protected void addAuthenticationMethodAttribute(final AuthenticationBuilder builder,
                                                    final Authentication authentication) {
        authentication.getSuccesses().values().forEach(result -> builder.addAttribute(AUTHENTICATION_METHOD_ATTRIBUTE, result.getHandlerName()));
    }
333984
public void setUsername(String username) {
        for (Authentication auth : authentications.values()) {
            if (auth instanceof HttpBasicAuth) {
                ((HttpBasicAuth) auth).setUsername(username);
                return;
            }
        }
        throw new RuntimeException("No HTTP basic authentication configured!");
    }
1154396
protected final void clearAuthenticationAttributes() {
        HttpSession session = http.getCurrentRequest().getSession(false);

        if (session == null) {
            return;
        }

        session.removeAttribute(WebAttributes.AUTHENTICATION_EXCEPTION);
    }
552168
public void addAuthenticationAttributes(Map<String, Object> attributeMap) {
        if (attributeMap != null) {
            for (final Map.Entry<String, Object> entry : attributeMap.entrySet()) {
                addAuthenticationAttribute(entry.getKey(), entry.getValue());
            }
        }
    }
61675
public SingleNodeAssert hasAttribute(String attributeName) {
        isNotNull();

        final Map.Entry<QName, String> entry = attributeForName(attributeName);
        if (entry == null) {
            throwAssertionError(shouldHaveAttribute(actual.getNodeName(), attributeName));
        }
        return this;
    }