@Override public void doRemoveClient(Client c) { clientsMap.remove(c.getClientId()); } @Override
@Override public void doRemoveClient(Client c) { clientsMap.remove(c.getClientId()); } @Override
public Client getClient(String clientId) throws OAuthServiceException { return client == null || !client.getClientId().equals(clientId) ? null : client; }
@Override public Void execute(EntityManager em) { Client clientToRemove = em.getReference(Client.class, c.getClientId()); em.remove(clientToRemove); return null; } });
@Override public void setClient(Client client) { clientsMap.put(client.getClientId(), ModelEncryptionSupport.encryptClient(client, key)); } @Override
@Override public void setClient(Client client) { clientsMap.put(client.getClientId(), ModelEncryptionSupport.encryptClient(client, key)); } @Override
@Override protected void doRemoveClient(Client c) { clientCache.remove(c.getClientId()); }
@Override public Void execute(EntityManager em) { Client clientToRemove = em.getReference(Client.class, c.getClientId()); em.remove(clientToRemove); return null; } });
public void setClient(Client client) { clientCache.put(client.getClientId(), client); }
@Override protected void doRemoveClient(Client c) { clientCache.remove(c.getClientId()); }
public void setClient(Client client) { clientCache.put(client.getClientId(), client); }
protected static boolean isTokenMatched(ServerAccessToken token, Client c, UserSubject sub) { if (token != null && (c == null || token.getClient().getClientId().equals(c.getClientId()))) { UserSubject tokenSub = token.getSubject(); if (sub == null || tokenSub != null && tokenSub.getLogin().equals(sub.getLogin())) { return true; } } return false; } public void setClients(List<Client> clients) {
public static boolean isCodeMatched(ServerAuthorizationCodeGrant grant, Client c, UserSubject sub) { if (grant != null && (c == null || grant.getClient().getClientId().equals(c.getClientId()))) { UserSubject grantSub = grant.getSubject(); return sub == null || grantSub != null && grantSub.getLogin().equals(sub.getLogin()); } return false; } }
@Override public Void execute(EntityManager em) { removeClientCodeGrants(c, em); Client clientToRemove = em.getReference(Client.class, c.getClientId()); em.remove(clientToRemove); return null; } });
@Override public Void execute(EntityManager em) { removeClientCodeGrants(c, em); Client clientToRemove = em.getReference(Client.class, c.getClientId()); em.remove(clientToRemove); return null; } });
@Override public void setClient(Client client) { clients.put(client.getClientId(), client); }
protected static boolean isTokenMatched(ServerAccessToken token, Client c, UserSubject sub) { if (token != null && (c == null || token.getClient().getClientId().equals(c.getClientId()))) { UserSubject tokenSub = token.getSubject(); if (sub == null || tokenSub != null && tokenSub.getLogin().equals(sub.getLogin())) { return true; } } return false; } public void setClients(List<Client> clients) {
public static boolean isCodeMatched(ServerAuthorizationCodeGrant grant, Client c, UserSubject sub) { if (grant != null && (c == null || grant.getClient().getClientId().equals(c.getClientId()))) { UserSubject grantSub = grant.getSubject(); return sub == null || grantSub != null && grantSub.getLogin().equals(sub.getLogin()); } return false; } }
public List<ServerAuthorizationCodeGrant> getCodeGrants(Client c, UserSubject sub) { List<ServerAuthorizationCodeGrant> list = new ArrayList<>(grants.size()); for (String key : grants) { ServerAuthorizationCodeGrant grant = getCodeGrant(key); if (c == null || grant.getClient().getClientId().equals(c.getClientId())) { UserSubject grantSub = grant.getSubject(); if (sub == null || grantSub != null && grantSub.getLogin().equals(sub.getLogin())) { list.add(grant); } } } return list; }
protected Client getAndValidateClientFromIdAndSecret(String clientId, String providedClientSecret, MultivaluedMap<String, String> params) { Client client = getClient(clientId, providedClientSecret, params); if (!client.getClientId().equals(clientId)) { reportInvalidClient(); } if (!client.isConfidential() || !isConfidenatialClientSecretValid(client, providedClientSecret)) { reportInvalidClient(); } return client; } protected boolean isConfidenatialClientSecretValid(Client client, String providedClientSecret) {