Package org.gatein.wci.security

Examples of org.gatein.wci.security.Credentials


         sharedState.containsKey("javax.security.auth.login.password") &&
         sharedState.get(LOGIN_ON_DIFFERENT_NODE) == null)
      {
         String uid = (String)sharedState.get("javax.security.auth.login.name");

         Credentials wc = new Credentials(uid, "");

         HttpServletRequest request = null;
         try
         {
            request = getCurrentHttpServletRequest();
View Full Code Here


   public GateInToken getToken()
   {
      return new GateInToken(
         getExpirationTime().getTime(),
         new Credentials(getUserName(), getPassword()));
   }
View Full Code Here

      }
      catch (ServletException se)
      {
         try
         {
            String ticket = GenericAuthentication.TICKET_SERVICE.createTicket(new Credentials(credentials.getUsername(), credentials.getPassword()), TicketService.DEFAULT_VALIDITY);
            String url = "j_security_check?j_username=" + credentials.getUsername() + "&j_password=" + ticket + "&initialURI=" + initialURI;
            url = response.encodeRedirectURL(url);
            response.sendRedirect(url);
            response.flushBuffer();
         }
View Full Code Here

      {
         String fakePassword = req.getSession().getId() + "_" + String.valueOf(System.currentTimeMillis());

         // Try to use username from authenticated credentials
         String username;
         Credentials creds = (Credentials)req.getSession().getAttribute(GenericAgent.AUTHENTICATED_CREDENTIALS);
         if (creds != null)
         {
            username = creds.getUsername();
         }
         else
         {
            // Fallback to fakePassword, but this should't happen (credentials should always be available when this method is called)
            username = fakePassword;
View Full Code Here

          log.debug("HttpServletRequest is null. SSOLoginModule will be ignored.");
          return false;
       }


       Credentials credsFromSession = (Credentials)request.getSession().getAttribute(GenericAgent.AUTHENTICATED_CREDENTIALS);
       if (credsFromSession != null)
       {
         username = credsFromSession.getUsername();
          if (log.isTraceEnabled())
          {
             log.trace("Found credentials in session. Username: " + username);
          }
       }
View Full Code Here

      if (GTN_CURRENT_USER.equals(userValue))
      {
         CredentialsAccessor credentialsAccessor = CredentialsAccess.getInstance().getCredentialsAccessor();
         if (credentialsAccessor != null && credentialsAccessor.getCredentials() != null)
         {
            Credentials credentials = credentialsAccessor.getCredentials();
            propertyMap.put(WSHandlerConstants.USER, credentials.getUsername());

            String actionProperty = (String)propertyMap.get(WSHandlerConstants.ACTION);
            //Note: the action property can contain a space separated list of multiple actions
            if (actionProperty != null && actionProperty.contains(GTN_USERNAME_TOKEN_IF_AUTHENTICATED))
            {
               if (credentials.getPassword() != null)
               {
                  actionProperty = actionProperty.replace(GTN_USERNAME_TOKEN_IF_AUTHENTICATED, WSHandlerConstants.USERNAME_TOKEN);
               }
               else
               {
View Full Code Here

            {
               CredentialsAccessor credentialsAccessor = CredentialsAccess.getInstance().getCredentialsAccessor();

               if (credentialsAccessor != null && credentialsAccessor.getCredentials() != null)
               {
                  Credentials credentials = credentialsAccessor.getCredentials();
                  if (credentials.getUsername().equals(wspasswordCallBack.getIdentifier()))
                  {
                     wspasswordCallBack.setPassword(credentials.getPassword());
                  }
                  else
                  {
                     log.warn("The username in the callback does not match the currently authenticated user. Password not added to callback.");
                  }
View Full Code Here

         CredentialsAccessor credentialsAccessor = CredentialsAccess.getInstance().getCredentialsAccessor();

         if (credentialsAccessor != null && credentialsAccessor.getCredentials() != null)
         {
            Credentials credentials = credentialsAccessor.getCredentials();
            ctx.put(BindingProvider.USERNAME_PROPERTY, credentials.getUsername());
            ctx.put(BindingProvider.PASSWORD_PROPERTY, credentials.getPassword());
         }
         else
         {
            log.debug("Could not find credentials to put in WS-Security header");
         }
View Full Code Here

TOP

Related Classes of org.gatein.wci.security.Credentials

Copyright © 2018 www.massapicom. 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.