Examples of AuthConfigFactory


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

      AuthStatus status = AuthStatus.FAILURE;
     
      try
      {
         String contextID = PolicyContext.getContextID();
         AuthConfigFactory factory = AuthConfigFactory.getFactory();
         AuthConfigProvider provider = factory.getConfigProvider(layer,contextID,null);
         if(provider == null)
            throw new IllegalStateException("Provider is null for "+ layer + " for "+ contextID);
        
         ServerAuthConfig serverConfig = provider.getServerAuthConfig(layer,contextID,handler)
         ServerAuthContext sctx = serverConfig.getAuthContext(contextID,
View Full Code Here

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

    public Authenticator getAuthenticator(Server server, ServletContext context, AuthConfiguration configuration, IdentityService identityService, LoginService loginService)
    {
        Authenticator authenticator=null;
        try
        {
            AuthConfigFactory authConfigFactory = AuthConfigFactory.getFactory();
            RegistrationListener listener = new RegistrationListener()
            {
                public void notify(String layer, String appContext)
                {}
            };

            Subject serviceSubject=findServiceSubject(server);
            String serverName=findServerName(server,serviceSubject);
            String appContext = serverName + " " + context.getContextPath();
           
            AuthConfigProvider authConfigProvider = authConfigFactory.getConfigProvider(MESSAGE_LAYER,appContext,listener);
 
            if (authConfigProvider != null)
            {
                ServletCallbackHandler servletCallbackHandler = new ServletCallbackHandler(loginService);
                ServerAuthConfig serverAuthConfig = authConfigProvider.getServerAuthConfig(MESSAGE_LAYER,appContext,servletCallbackHandler);
View Full Code Here

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

      AuthStatus status = AuthStatus.FAILURE;
     
      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)
View Full Code Here

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

      AuthStatus status = AuthStatus.FAILURE;
     
      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)
View Full Code Here

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

        }
        IdentityService identityService = new GeronimoIdentityService(defaultSubject);
        UserIdentity unauthenticatedIdentity = identityService.newUserIdentity(defaultSubject, null, null);
        LoginService loginService = new GeronimoLoginService(configurationFactory, identityService);
        Authenticator authenticator;
        AuthConfigFactory authConfigFactory = AuthConfigFactory.getFactory();
        RegistrationListener listener = new RegistrationListener() {

            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 {
View Full Code Here

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

                                            @ParamAttribute(name = "allowLazyAuthentication") boolean allowLazyAuthentication,
                                            @ParamReference(name = "ConfigurationFactory") ConfigurationFactory configurationFactory
    ) throws AuthException {
        this.appContext = appContext;
        this.allowLazyAuthentication = allowLazyAuthentication;
        AuthConfigFactory authConfigFactory = AuthConfigFactory.getFactory();
        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.AuthConfigFactory

            @ParamAttribute(name = "authenticationID") String authenticationID,
            @ParamAttribute(name = "config") String config,
            @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.AuthConfigFactory

     * Stops the target.  This informs the GBean that it is about to transition to the stopped state.
     *
     * @throws Exception if the target failed to stop; this will cause a transition to the failed state
     */
    public void doStop() throws Exception {
        AuthConfigFactory authConfigFactory = AuthConfigFactory.getFactory();
        authConfigFactory.removeRegistration(registrationID);
    }
View Full Code Here

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

        ClassLoaderLookup classLoaderLookup = new ConstantClassLoaderLookup(classLoader);

        String messageLayer = null;
        String appContext = null;

        AuthConfigFactory authConfigFactory = AuthConfigFactory.getFactory();
        ConfigProviderType configProviderType = JaspiXmlUtil.loadConfigProvider(new StringReader(config));
        AuthConfigProvider authConfigProvider = JaspiUtil.wraptAuthConfigProvider(configProviderType, classLoaderLookup);
        registrationID = authConfigFactory.registerConfigProvider(authConfigProvider, messageLayer, appContext, null);
    }
View Full Code Here

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

     * Stops the target.  This informs the GBean that it is about to transition to the stopped state.
     *
     * @throws Exception if the target failed to stop; this will cause a transition to the failed state
     */
    public void doStop() throws Exception {
        AuthConfigFactory authConfigFactory = AuthConfigFactory.getFactory();
        authConfigFactory.removeRegistration(registrationID);
    }
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.