Package org.keycloak.models.jpa.entities

Examples of org.keycloak.models.jpa.entities.OAuthClientEntity


        return new ApplicationAdapter(realm, em, session, app);
    }

    @Override
    public OAuthClientModel getOAuthClientById(String id, RealmModel realm) {
        OAuthClientEntity client = em.find(OAuthClientEntity.class, id);

        // Check if client belongs to this realm
        if (client == null || !realm.getId().equals(client.getRealm().getId())) return null;
        return new OAuthClientAdapter(realm, client, em);
    }
View Full Code Here


        return this.addOAuthClient(KeycloakModelUtils.generateId(), name);
    }

    @Override
    public OAuthClientModel addOAuthClient(String id, String name) {
        OAuthClientEntity data = new OAuthClientEntity();
        data.setId(id);
        data.setEnabled(true);
        data.setName(name);
        data.setRealm(realm);
        em.persist(data);
        em.flush();
        return new OAuthClientAdapter(this, data, em);
    }
View Full Code Here

    @Override
    public boolean removeOAuthClient(String id) {
        OAuthClientModel oauth = getOAuthClientById(id);
        if (oauth == null) return false;
        OAuthClientEntity client = em.getReference(OAuthClientEntity.class, oauth.getId());
        em.createNamedQuery("deleteScopeMappingByClient").setParameter("client", client).executeUpdate();
        em.remove(client);
        return true;
    }
View Full Code Here

TOP

Related Classes of org.keycloak.models.jpa.entities.OAuthClientEntity

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.