Examples of sessions()


Examples of org.keycloak.models.KeycloakSession.sessions()

        Thread.sleep(2000);

        session = keycloakRule.startSession();
        realm = session.realms().getRealmByName("demo");
        session.sessions().removeExpiredUserSessions(realm);
        session.getTransaction().commit();
        session.close();

        // test SSO
        driver.navigate().to("http://localhost:8081/product-portal");
View Full Code Here

Examples of org.keycloak.models.KeycloakSession.sessions()

            RealmModel adminRealm = manager.getRealm(Config.getAdminRealm());
            ApplicationModel adminConsole = adminRealm.getApplicationByName(Constants.ADMIN_CONSOLE_APPLICATION);
            TokenManager tm = new TokenManager();
            UserModel admin = session.users().getUserByUsername("admin", adminRealm);
            UserSessionModel userSession = session.sessions().createUserSession(adminRealm, admin, "admin", null, "form", false);
            AccessToken token = tm.createClientAccessToken(tm.getAccess(null, adminConsole, admin), adminRealm, adminConsole, admin, userSession);
            return tm.encodeToken(adminRealm, token);
        } finally {
            keycloakRule.stopSession(session, true);
        }
View Full Code Here

Examples of org.keycloak.models.KeycloakSession.sessions()

            RealmModel adminRealm = manager.getRealm(Config.getAdminRealm());
            ApplicationModel adminConsole = adminRealm.getApplicationByName(Constants.ADMIN_CONSOLE_APPLICATION);
            TokenManager tm = new TokenManager();
            UserModel admin = session.users().getUserByUsername("admin", adminRealm);
            UserSessionModel userSession = session.sessions().createUserSession(adminRealm, admin, "admin", null, "form", false);
            AccessToken token = tm.createClientAccessToken(tm.getAccess(null, adminConsole, admin), adminRealm, adminConsole, admin, userSession);
            return tm.encodeToken(adminRealm, token);
        } finally {
            keycloakRule.stopSession(session, true);
        }
View Full Code Here

Examples of org.keycloak.models.KeycloakSession.sessions()


    public void removeUserSession(String sessionId) {
        KeycloakSession session = startSession();
        RealmModel realm = session.realms().getRealm("test");
        UserSessionModel userSession = session.sessions().getUserSession(realm, sessionId);
        assertNotNull(userSession);
        session.sessions().removeUserSession(realm, userSession);
        stopSession(session, true);
    }
View Full Code Here

Examples of org.keycloak.models.KeycloakSession.sessions()

    public void removeUserSession(String sessionId) {
        KeycloakSession session = startSession();
        RealmModel realm = session.realms().getRealm("test");
        UserSessionModel userSession = session.sessions().getUserSession(realm, sessionId);
        assertNotNull(userSession);
        session.sessions().removeUserSession(realm, userSession);
        stopSession(session, true);
    }

    public ClientSessionCode verifyCode(String code) {
        KeycloakSession session = startSession();
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.