Examples of AuthConfigProvider


Examples of javax.security.auth.message.config.AuthConfigProvider

            @ParamSpecial(type = SpecialAttributeType.classLoader) ClassLoader classLoader) throws AuthException, JAXBException, IOException, ParserConfigurationException, SAXException, XMLStreamException {
        ClassLoaderLookup classLoaderLookup = new ConstantClassLoaderLookup(classLoader);

        AuthConfigFactory authConfigFactory = AuthConfigFactory.getFactory();
        AuthModuleType<ServerAuthModule> serverAuthModuleType = JaspiXmlUtil.loadServerAuthModule(new StringReader(config));
        AuthConfigProvider authConfigProvider = JaspiUtil.wrapServerAuthModule(messageLayer, appContext, authenticationID, serverAuthModuleType, true, classLoaderLookup);
        registrationID = authConfigFactory.registerConfigProvider(authConfigProvider, messageLayer, appContext, null);
    }
View Full Code Here

Examples of javax.security.auth.message.config.AuthConfigProvider

        RegistrationListener listener = new RegistrationListener() {

            public void notify(String layer, String appContext) {
            }
        };
        AuthConfigProvider authConfigProvider = authConfigFactory.getConfigProvider(messageLayer, appContext, listener);
        this.loginService = new JAASLoginService(configurationFactory, null);
        servletCallbackHandler = new ServletCallbackHandler(loginService);
        serverAuthConfig = authConfigProvider.getServerAuthConfig(messageLayer, appContext, servletCallbackHandler);
        //TODO appContext is supposed to be server-name<space>context-root

    }
View Full Code Here

Examples of javax.security.auth.message.config.AuthConfigProvider

            public void notify(String layer, String appContext) {
            }
        };
        //?? TODO is context.getPath() the context root?
        String appContext = "server " + geronimoContext.getPath();
        AuthConfigProvider authConfigProvider = authConfigFactory.getConfigProvider(MESSAGE_LAYER, appContext, listener);
        ServerAuthConfig serverAuthConfig = null;
        JaspicCallbackHandler callbackHandler = null;
        if (authConfigProvider != null) {
            callbackHandler = new JaspicCallbackHandler(loginService);
            try {
                serverAuthConfig = authConfigProvider.getServerAuthConfig(MESSAGE_LAYER, appContext, callbackHandler);
            } catch (AuthException e) {
                //TODO log exception?  rethrow????
            }
        }
        if (serverAuthConfig != null) {
View Full Code Here

Examples of javax.security.auth.message.config.AuthConfigProvider

     
      try
      {
         String contextID = PolicyContext.getContextID();
         AuthConfigFactory factory = AuthConfigFactory.getFactory();
         AuthConfigProvider provider = factory.getConfigProvider(layer,contextID,null);
         ServerAuthConfig serverConfig = provider.getServerAuthConfig(layer,contextID,
                  new AppCallbackHandler("DUMMY","DUMMY".toCharArray()))
         ServerAuthContext sctx = serverConfig.getAuthContext(contextID,
               new Subject(), new HashMap());
         if(clientSubject == null)
            clientSubject = new Subject();
View Full Code Here

Examples of javax.security.auth.message.config.AuthConfigProvider

     
      try
      {
         String contextID = PolicyContext.getContextID();
         AuthConfigFactory factory = AuthConfigFactory.getFactory();
         AuthConfigProvider provider = factory.getConfigProvider(layer,contextID,null);
         ServerAuthConfig serverConfig = provider.getServerAuthConfig(layer,contextID,
                  new AppCallbackHandler("DUMMY","DUMMY".toCharArray()))
         ServerAuthContext sctx = serverConfig.getAuthContext(contextID,
               new Subject(), new HashMap());
         if(clientSubject == null)
            clientSubject = new Subject();
View Full Code Here

Examples of javax.security.auth.message.config.AuthConfigProvider

            public void notify(String layer, String appContext) {
            }
        };
        //?? TODO is context.getPath() the context root?
        String appContext = "server " + geronimoContext.getPath();
        AuthConfigProvider authConfigProvider = authConfigFactory.getConfigProvider(MESSAGE_LAYER, appContext, listener);
        ServerAuthConfig serverAuthConfig = null;
        CallbackHandler callbackHandler = null;
        if (authConfigProvider != null) {
            callbackHandler = new JaspicCallbackHandler(loginService);
            try {
                serverAuthConfig = authConfigProvider.getServerAuthConfig(MESSAGE_LAYER, appContext, callbackHandler);
            } catch (AuthException e) {
                //TODO log exception?  rethrow????
            }
        }
        if (serverAuthConfig != null) {
View Full Code Here

Examples of javax.security.auth.message.config.AuthConfigProvider

        RegistrationListener listener = new RegistrationListener() {

            public void notify(String layer, String appContext) {
            }
        };
        AuthConfigProvider authConfigProvider = authConfigFactory.getConfigProvider(messageLayer, appContext, listener);
        CallbackHandler callbackHandler = new JaspicCallbackHandler(loginService);
        ServerAuthConfig serverAuthConfig = authConfigProvider.getServerAuthConfig(messageLayer, appContext, callbackHandler);
        //TODO appContext is supposed to be server-name<space>context-root
        Authenticator authenticator = new GeronimoJaspiAuthenticator(serverAuthConfig, authConfigProperties, callbackHandler, serviceSubject, allowLazyAuthentication, identityService);
        //login service functionality is already inside the servletCallbackHandler
        return new JaccSecurityHandler(policyContextID, authenticator, new JAASLoginService(null, loginService), identityService, defaultAcc);
    }
View Full Code Here

Examples of javax.security.auth.message.config.AuthConfigProvider

     
      String layer = SecurityConstants.SERVLET_LAYER;
      //Register an AuthConfigProvider for all appcontext in a layer
      factory.registerConfigProvider( allACProvider, new HashMap(),
                                  layer, null, "This is a test provider");
      AuthConfigProvider acp = factory.getConfigProvider(layer,"testAppContext", rl);
      String[] ids = factory.getRegistrationIDs(acp);
      String[] detachedIds = factory.detachListener(rl, layer, "testAppContext");
      checkStringArrayEquals(ids, detachedIds);
   }
View Full Code Here

Examples of javax.security.auth.message.config.AuthConfigProvider

            server.invoke(oname,"registerSecurityDomain",
                  new Object[]{securityDomain,contextId},
                  new String[] {"java.lang.String", "java.lang.String"} );
         }
         AuthConfigFactory factory = AuthConfigFactory.getFactory();
         AuthConfigProvider acp = factory.getConfigProvider(SecurityConstants.SERVLET_LAYER,
                                            contextId,null);
         if(acp == null)
         {
            acp = new JBossAuthConfigProvider(null);
        
         CallbackHandler cbh = new SecurityAssociationHandler();
         ServerAuthConfig sc = acp.getServerAuthConfig(SecurityConstants.SERVLET_LAYER,
                                            contextId,cbh);
         if(sc == null)
            throw new ServletException("ServerAuthConfig is null");
         ServerAuthContext sa = sc.getAuthContext(null,null, null);
         if(sa == null)
View Full Code Here

Examples of javax.security.auth.message.config.AuthConfigProvider

     */
    public AuthConfigProvider
            getConfigProvider(String layer, String appContext,
      RegistrationListener listener) {

  AuthConfigProvider provider = null;
        String regisID = getRegistrationID(layer, appContext);
        rLock.lock();
        boolean providerFound = false;
  try {
            if (id2ProviderMap.containsKey(regisID)) {
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.