Examples of LoginContext


Examples of javax.security.auth.login.LoginContext

                LOG.debug(ex.getMessage(), ex);
            }
        }
       
        // Get a TGT from the KDC using JAAS
        LoginContext loginContext = null;
        try {
            if (callbackHandler != null) {
                loginContext = new LoginContext(getContextName(), callbackHandler);
            } else if (data.getCallbackHandler() != null) {
                loginContext = new LoginContext(getContextName(), data.getCallbackHandler());
            } else {
                loginContext = new LoginContext(getContextName());
            }
            loginContext.login();
        } catch (LoginException ex) {
            if (LOG.isDebugEnabled()) {
                LOG.debug(ex.getMessage(), ex);
            }
            throw new WSSecurityException(
                WSSecurityException.ErrorCode.FAILURE,
                "kerberosLoginError",
                ex,
                ex.getMessage());
        }
        if (LOG.isDebugEnabled()) {
            LOG.debug("Successfully authenticated to the TGT");
        }
       
        byte[] token = binarySecurity.getToken();
       
        // Get the service name to use - fall back on the principal
        Subject subject = loginContext.getSubject();
        String service = serviceName;
        if (service == null) {
            Set<Principal> principals = subject.getPrincipals();
            if (principals.isEmpty()) {
                throw new WSSecurityException(
View Full Code Here

Examples of org.apache.jackrabbit.oak.spi.security.authentication.LoginContext

        if (!defaultWorkspaceName.equals(workspaceName)) {
            throw new NoSuchWorkspaceException(workspaceName);
        }

        LoginContextProvider lcProvider = securityProvider.getConfiguration(AuthenticationConfiguration.class).getLoginContextProvider(this);
        LoginContext loginContext = lcProvider.getLoginContext(credentials, workspaceName);
        loginContext.login();

        return new ContentSessionImpl(loginContext, securityProvider, workspaceName, nodeStore,
                commitHook, indexProvider);
    }
View Full Code Here

Examples of org.apache.wicket.security.hive.authentication.LoginContext

      private static final long serialVersionUID = 1L;

      @Override
      public boolean signIn(String username, String password)
      {
        LoginContext ctx = new Level0Context(username, password);
        try
        {
          ((WaspSession) getSession()).login(ctx);
        }
        catch (LoginException e)
View Full Code Here

Examples of org.wicketstuff.security.hive.authentication.LoginContext

   */
  public boolean login(String username)
  {
    try
    {
      LoginContext context;
      if ("test".equals(username))
      {
        context = new PrimaryLoginContext();
      }
      else if ("all".equals(username))
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.