code: public DeploymentInfo addLastAuthenticationMechanism(final String name, final AuthenticationMechanism mechanism) {
          authenticationMechanisms.put(name, new ImmediateAuthenticationMechanismFactory(mechanism));
          if(loginConfig == null) {
              loginConfig = new LoginConfig(null);
          }
          loginConfig.addLastAuthMethod(new AuthMethodConfig(name));
          return this;
      }
docs: Adds an authentication mechanism directly to the deployment. This mechanism will be last in the list.
  
  In general you should just use {@link #addAuthenticationMechanism(String, io.undertow.security.api.AuthenticationMechanismFactory)}
  and allow the user to configure the methods they want by name.
  
  This method is essentially a convenience method, if is the same as registering a factory under the provided name that returns
  and authentication mechanism, and then adding it to the login config list.
  
  If you want your mechanism to be the only one in the deployment you should first invoke {@link #clearLoginMethods()}.
  
  @param name The authentication mechanism name
  @param mechanism The mechanism
  @return