Package javax.security.auth.message.module

Examples of javax.security.auth.message.module.ServerAuthModule


    JaspiAuthenticatorFactory jaspiAuthenticatorFactory = new JaspiAuthenticatorFactory();
    jaspiAuthenticatorFactory.setLoginService(getHandlerLoginService());

    HashMap<String, ServerAuthContext> serverAuthContextMap = new HashMap<String, ServerAuthContext>();
    ServletCallbackHandler callbackHandler = new ServletCallbackHandler(getHandlerLoginService());
    ServerAuthModule authModule = new BasicAuthModule(callbackHandler, "JAASRealm");
    serverAuthContextMap.put("authContextID", new ServerAuthContextImpl(Collections.singletonList(authModule)));

    ServerAuthContextType serverAuthContextType = new ServerAuthContextType("HTTP", "server *",
                                                                            "authContextID",
                                                                            new AuthModuleType<ServerAuthModule>());
View Full Code Here


               + " or "+ defaultAppDomain);
     
      if(bai instanceof AuthenticationInfo)
      {
         //Need to get a wrapper
         ServerAuthModule sam = new DelegatingServerAuthModule();
         Map options = new HashMap();
         options.put("javax.security.auth.login.LoginContext", secDomain); //Name of sec domain
         sam.initialize(null, null, new SecurityAssociationHandler(), options);
         modules.add(sam);
      }
      else
      {
         JASPIAuthenticationInfo jai = (JASPIAuthenticationInfo)bai;
View Full Code Here

      AuthStatus overallDecision = AuthStatus.FAILURE;
     
      int length = modules.size();
      for(int i = 0; i < length; i++)
      {
         ServerAuthModule module = (ServerAuthModule)modules.get(i);
         ControlFlag flag = (ControlFlag)this.controlFlags.get(i);
         AuthStatus decision = AuthStatus.FAILURE;
         try
         {
            decision = module.validateRequest(messageInfo, clientSubject, serviceSubject);
         }
         catch(Exception ae)
         {
            decision = AuthStatus.FAILURE;
            if(moduleException == null)
View Full Code Here

               + " or "+ defaultAppDomain);
     
      if(bai instanceof AuthenticationInfo)
      {
         //Need to get a wrapper
         ServerAuthModule sam = new DelegatingServerAuthModule();
         Map options = new HashMap();
         options.put("javax.security.auth.login.LoginContext", secDomain); //Name of sec domain
         sam.initialize(null, null, this.callbackHandler, options);
         modules.add(sam);
      }
      else
      {
         JASPIAuthenticationInfo jai = (JASPIAuthenticationInfo)bai;
         AuthModuleEntry[] amearr = jai.getAuthModuleEntry();
         for(AuthModuleEntry ame: amearr)
         {
            if(ame.getLoginModuleStackHolderName() != null)
            {
               try
               {
                  mapOptionsByName.put(ame.getAuthModuleName(), ame.getOptions());
                  controlFlags.add(ame.getControlFlag());  
                  ServerAuthModule sam = this.createSAM(ame.getAuthModuleName(),
                        ame.getLoginModuleStackHolderName());
                 
                  Map options = new HashMap();
                 
                  sam.initialize(null, null, callbackHandler, options);
                  modules.add(sam);
               }
               catch (Exception e)
               {
                  throw new AuthException(e.getLocalizedMessage());
               }
            }
            else
            {
               try
               {
                  mapOptionsByName.put(ame.getAuthModuleName(), ame.getOptions());
                  controlFlags.add(ame.getControlFlag());            
                  ServerAuthModule sam = this.createSAM(ame.getAuthModuleName());
                 
                  Map options = new HashMap();
                  sam.initialize(null, null, callbackHandler, options);
                  modules.add(sam);
               }
               catch (Exception e)
               {
                  throw new AuthException(e.getLocalizedMessage());
View Full Code Here

            }

            // no doPrivilege at this point, need to revisit
            if (SERVER.equals(type)) {
                if (newModule instanceof ServerAuthModule) {
                    ServerAuthModule sam = (ServerAuthModule)newModule;
                    sam.initialize(entry.getRequestPolicy(),
                        entry.getResponsePolicy(), handler, map);
                } else if (newModule instanceof
                        com.sun.enterprise.security.jauth.ServerAuthModule) {

                    com.sun.enterprise.security.jauth.ServerAuthModule sam0 =
View Full Code Here

               + " or "+ defaultAppDomain);
     
      if(bai instanceof AuthenticationInfo)
      {
         //Need to get a wrapper
         ServerAuthModule sam = new DelegatingServerAuthModule();
         Map options = new HashMap();
         options.put("javax.security.auth.login.LoginContext", secDomain); //Name of sec domain
         sam.initialize(null, null, this.callbackHandler, options);
         modules.add(sam);
      }
      else
      {
         JASPIAuthenticationInfo jai = (JASPIAuthenticationInfo)bai;
         AuthModuleEntry[] amearr = jai.getAuthModuleEntry();
         for(AuthModuleEntry ame: amearr)
         {
            if(ame.getLoginModuleStackHolderName() != null)
            {
               try
               {
                  mapOptionsByName.put(ame.getAuthModuleName(), ame.getOptions());
                  controlFlags.add(ame.getControlFlag());  
                  ServerAuthModule sam = this.createSAM(ame.getAuthModuleName(),
                        ame.getLoginModuleStackHolderName());
                 
                  Map options = new HashMap();
                 
                  sam.initialize(null, null, callbackHandler, options);
                  modules.add(sam);
               }
               catch (Exception e)
               {
                  throw new AuthException(e.getLocalizedMessage());
               }
            }
            else
            {
               try
               {
                  mapOptionsByName.put(ame.getAuthModuleName(), ame.getOptions());
                  controlFlags.add(ame.getControlFlag());            
                  ServerAuthModule sam = this.createSAM(ame.getAuthModuleName());
                 
                  Map options = new HashMap();
                  sam.initialize(null, null, callbackHandler, options);
                  modules.add(sam);
               }
               catch (Exception e)
               {
                  throw new AuthException(e.getLocalizedMessage());
View Full Code Here

/* 107 */       throw new IllegalStateException("Authentication Info not set in security domain=" + secDomain + " or " + defaultAppDomain);
/*     */     }
/*     */
/* 110 */     if ((bai instanceof AuthenticationInfo))
/*     */     {
/* 113 */       ServerAuthModule sam = new DelegatingServerAuthModule();
/* 114 */       Map options = new HashMap();
/* 115 */       options.put("javax.security.auth.login.LoginContext", secDomain);
/* 116 */       sam.initialize(null, null, new SecurityAssociationHandler(), options);
/* 117 */       this.modules.add(sam);
/*     */     }
/*     */     else
/*     */     {
/* 121 */       JASPIAuthenticationInfo jai = (JASPIAuthenticationInfo)bai;
View Full Code Here

      AuthStatus overallDecision = AuthStatus.FAILURE;
     
      int length = modules.size();
      for(int i = 0; i < length; i++)
      {
         ServerAuthModule module = (ServerAuthModule)modules.get(i);
         ControlFlag flag = (ControlFlag)this.controlFlags.get(i);
         AuthStatus decision = AuthStatus.FAILURE;
         try
         {
            decision = module.validateRequest(messageInfo, clientSubject, serviceSubject);
         }
         catch(Exception ae)
         {
            decision = AuthStatus.FAILURE;
            if(moduleException == null)
View Full Code Here

               + " or "+ defaultAppDomain);
     
      if(bai instanceof AuthenticationInfo)
      {
         //Need to get a wrapper
         ServerAuthModule sam = new DelegatingServerAuthModule();
         Map options = new HashMap();
         options.put("javax.security.auth.login.LoginContext", secDomain); //Name of sec domain
         sam.initialize(null, null, this.callbackHandler, options);
         modules.add(sam);
      }
      else
      {
         JASPIAuthenticationInfo jai = (JASPIAuthenticationInfo)bai;
         AuthModuleEntry[] amearr = jai.getAuthModuleEntry();
         for(AuthModuleEntry ame: amearr)
         {
            if(ame.getLoginModuleStackHolderName() != null)
            {
               try
               {
                  mapOptionsByName.put(ame.getAuthModuleName(), ame.getOptions());
                  controlFlags.add(ame.getControlFlag());  
                  ServerAuthModule sam = this.createSAM(ame.getAuthModuleName(),
                        ame.getLoginModuleStackHolderName());
                 
                  Map options = new HashMap();
                 
                  sam.initialize(null, null, callbackHandler, options);
                  modules.add(sam);
               }
               catch (Exception e)
               {
                  throw new AuthException(e.getLocalizedMessage());
               }
            }
            else
            {
               try
               {
                  mapOptionsByName.put(ame.getAuthModuleName(), ame.getOptions());
                  controlFlags.add(ame.getControlFlag());            
                  ServerAuthModule sam = this.createSAM(ame.getAuthModuleName());
                 
                  Map options = new HashMap();
                  sam.initialize(null, null, callbackHandler, options);
                  modules.add(sam);
               }
               catch (Exception e)
               {
                  throw new AuthException(e.getLocalizedMessage());
View Full Code Here

               + " or "+ defaultAppDomain);
     
      if(bai instanceof AuthenticationInfo)
      {
         //Need to get a wrapper
         ServerAuthModule sam = new DelegatingServerAuthModule();
         Map options = new HashMap();
         options.put("javax.security.auth.login.LoginContext", secDomain); //Name of sec domain
         sam.initialize(null, null, new SecurityAssociationHandler(), options);
         modules.add(sam);
      }
      else
      {
         JASPIAuthenticationInfo jai = (JASPIAuthenticationInfo)bai;
View Full Code Here

TOP

Related Classes of javax.security.auth.message.module.ServerAuthModule

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.