Examples of LoginModule


Examples of javax.security.auth.spi.LoginModule

            } catch (MalformedURLException e) {
                log.warn("Repository unable to look up JAR file", e);
            }
        }
        Class cls = loader.loadClass(getSelectedModule(data).getClassName());
        LoginModule module = (LoginModule) cls.newInstance();
        for (Iterator it = data.getOptions().keySet().iterator(); it.hasNext();) {
            String key = (String) it.next();
            final Object value = data.getOptions().get(key);
            if (value != null && !value.equals("")) {
                options.put(key, value);
View Full Code Here

Examples of javax.security.auth.spi.LoginModule

    private void actionAttemptLogin(RealmData data, PortletRequest request, PortletSession session, String username, String password) {
        session.removeAttribute("TestLoginPrincipals");
        session.removeAttribute("TestLoginError");
        Map options = new HashMap();
        try {
            LoginModule module = loadModule(request, data, options);
            Subject sub = PortletManager.testLoginModule(request, module, options, username, password);
            session.setAttribute("TestLoginPrincipals", sub.getPrincipals());
        } catch (Exception e) {
            log.warn("Test login failed", e);
            session.setAttribute("TestLoginError", "Login Failed: " + (e.getMessage() == null ? "no message" : e.getMessage()));
View Full Code Here

Examples of javax.security.auth.spi.LoginModule

     * populates them, and sends them back to the server.
     */
    public Callback[] getServerLoginCallbacks(JaasSessionId sessionHandle, int loginModuleIndex) throws LoginException {
        JaasSecuritySession session = (JaasSecuritySession) activeLogins.get(sessionHandle);
        checkContext(session, loginModuleIndex);
        LoginModule module = session.getLoginModule(loginModuleIndex);

        session.getHandler().setExploring();
        try {
            module.initialize(session.getSubject(), session.getHandler(), new HashMap(), session.getOptions(loginModuleIndex));
        } catch (Exception e) {
            log.error("Failed to initialize module", e);
        }
        try {
            module.login();
        } catch (LoginException e) {
            //expected
        }
        try {
            module.abort();
        } catch (LoginException e) {
            //makes no difference
        }
        return session.getHandler().finalizeCallbackList();
    }
View Full Code Here

Examples of javax.security.auth.spi.LoginModule

    }

    private String actionTestLoginModuleLoad(PortletRequest request, RealmData data) {
        Map options = new HashMap();
        try {
            LoginModule module = loadModule(request, data, options);
            log.warn("Testing with options " + options);
            try {
                PortletManager.testLoginModule(request, module, options);
                return null;
            } catch (Exception e) {
View Full Code Here

Examples of javax.security.auth.spi.LoginModule

            } catch (MalformedURLException e) {
                log.warn("Repository unable to look up JAR file", e);
            }
        }
        Class cls = loader.loadClass(getSelectedModule(data).getClassName());
        LoginModule module = (LoginModule) cls.newInstance();
        for (Iterator it = data.getOptions().keySet().iterator(); it.hasNext();) {
            String key = (String) it.next();
            final Object value = data.getOptions().get(key);
            if (value != null && !value.equals("")) {
                options.put(key, value);
View Full Code Here

Examples of javax.security.auth.spi.LoginModule

    private void actionAttemptLogin(RealmData data, PortletRequest request, PortletSession session, String username, String password) {
        session.removeAttribute("TestLoginPrincipals");
        session.removeAttribute("TestLoginError");
        Map options = new HashMap();
        try {
            LoginModule module = loadModule(request, data, options);
            Subject sub = PortletManager.testLoginModule(request, module, options, username, password);
            session.setAttribute("TestLoginPrincipals", sub.getPrincipals());
        } catch (Exception e) {
            log.warn("Test login failed", e);
            session.setAttribute("TestLoginError", "Login Failed: " + (e.getMessage() == null ? "no message" : e.getMessage()));
View Full Code Here

Examples of javax.security.auth.spi.LoginModule

    }

    private String actionTestLoginModuleLoad(PortletRequest request, RealmData data) {
        Map options = new HashMap();
        try {
            LoginModule module = loadModule(request, data, options);
            log.warn("Testing with options " + options);
            try {
                PortletManager.testLoginModule(request, module, options);
                return null;
            } catch (Exception e) {
View Full Code Here

Examples of javax.security.auth.spi.LoginModule

            } catch (MalformedURLException e) {
                log.warn("Repository unable to look up JAR file", e);
            }
        }
        Class cls = loader.loadClass(getSelectedModule(data).getClassName());
        LoginModule module = (LoginModule) cls.newInstance();
        for (Iterator it = data.getOptions().keySet().iterator(); it.hasNext();) {
            String key = (String) it.next();
            final Object value = data.getOptions().get(key);
            if (value != null && !value.equals("")) {
                options.put(key, value);
View Full Code Here

Examples of javax.security.auth.spi.LoginModule

    private void actionAttemptLogin(RealmData data, PortletRequest request, PortletSession session, String username, String password) {
        session.removeAttribute("TestLoginPrincipals");
        session.removeAttribute("TestLoginError");
        Map options = new HashMap();
        try {
            LoginModule module = loadModule(request, data, options);
            Subject sub = PortletManager.testLoginModule(request, module, options, username, password);
            session.setAttribute("TestLoginPrincipals", sub.getPrincipals());
        } catch (Exception e) {
            log.warn("Test login failed", e);
            session.setAttribute("TestLoginError", "Login Failed: " + (e.getMessage() == null ? "no message" : e.getMessage()));
View Full Code Here

Examples of javax.security.auth.spi.LoginModule

        clientHandle = service.connectToRealm(realmName);
        JaasLoginModuleConfiguration[] config = service.getLoginConfiguration(clientHandle);
        workers = new LoginModuleConfiguration[config.length];

        for (int i = 0; i < workers.length; i++) {
            LoginModule wrapper;
            if (config[i].isServerSide()) {
                wrapper = new ServerLoginModule(i);
            } else {
                LoginModule source = config[i].getLoginModule(JaasLoginCoordinator.class.getClassLoader());
                wrapper = new ClientLoginModule(source, i);
            }
            workers[i] = new LoginModuleConfiguration(wrapper, config[i].getFlag());
            workers[i].getModule().initialize(subject, handler, new HashMap(), config[i].getOptions());
        }
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.