Package org.keycloak.models

Examples of org.keycloak.models.OAuthClientModel


            createOAuthClient(rep, realm);
        }
    }

    public static OAuthClientModel createOAuthClient(String id, String name, RealmModel realm) {
        OAuthClientModel model = id!=null ? realm.addOAuthClient(id, name) : realm.addOAuthClient(name);
        KeycloakModelUtils.generateSecret(model);
        return model;
    }
View Full Code Here


        KeycloakModelUtils.generateSecret(model);
        return model;
    }

    public static OAuthClientModel createOAuthClient(OAuthClientRepresentation rep, RealmModel realm) {
        OAuthClientModel model = createOAuthClient(rep.getId(), rep.getName(), realm);
        updateOAuthClient(rep, model);
        return model;
    }
View Full Code Here

        if (cached != null && !cached.getRealm().equals(realm.getId())) {
            cached = null;
        }

        if (cached == null) {
            OAuthClientModel model = getDelegate().getOAuthClientById(id, realm);
            if (model == null) return null;
            if (clientInvalidations.contains(id)) return model;
            cached = new CachedOAuthClient(cache, getDelegate(), realm, model);
            cache.addCachedOAuthClient(cached);
        } else if (clientInvalidations.contains(id)) {
View Full Code Here

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || !(o instanceof OAuthClientModel)) return false;

        OAuthClientModel that = (OAuthClientModel) o;

        return that.getId().equals(this.getId());
    }
View Full Code Here

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || !(o instanceof OAuthClientModel)) return false;

        OAuthClientModel that = (OAuthClientModel) o;
        return that.getId().equals(getId());
    }
View Full Code Here

    }

    @Override
    public OAuthClientModel addOAuthClient(String name) {
        getDelegateForUpdate();
        OAuthClientModel client = updated.addOAuthClient(name);
        cacheSession.registerOAuthClientInvalidation(client.getId());
        return client;
    }
View Full Code Here

    }

    @Override
    public OAuthClientModel addOAuthClient(String id, String name) {
        getDelegateForUpdate();
        OAuthClientModel client =  updated.addOAuthClient(id, name);
        cacheSession.registerOAuthClientInvalidation(client.getId());
        return client;
    }
View Full Code Here

    @Override
    public List<OAuthClientModel> getOAuthClients() {
        if (updated != null) return updated.getOAuthClients();
        List<OAuthClientModel> clients = new LinkedList<OAuthClientModel>();
        for (String id : cached.getClients().values()) {
            OAuthClientModel model = cacheSession.getOAuthClientById(id, this);
            if (model == null) {
                throw new IllegalStateException("Cached oauth client not found: " + id);
            }
            clients.add(model);
        }
View Full Code Here

TOP

Related Classes of org.keycloak.models.OAuthClientModel

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.