Package org.surfnet.oaaas.model

Examples of org.surfnet.oaaas.model.Client


    accessTokenRequest.setClient(client);
  }
 
  private Client getClient(String clientId, String clientSecret, ValidationResponse error) {
    // Find the indicated client
    Client client = clientRepository.findByClientId(clientId);
    if (client == null) {
      throw new ValidationResponseException(error);
    }
   
    // Confirm that the credentials match those for the client
    if (!client.verifySecret(clientSecret)) {
      throw new ValidationResponseException(error);
    }
    return client;
  }
View Full Code Here


  }
 
  protected void validateAccessTokenRequest(AccessTokenRequest accessTokenRequest) {
    if (accessTokenRequest.getGrantType().equals(GRANT_TYPE_CLIENT_CREDENTIALS)) {
      // We must have a client
      Client client = accessTokenRequest.getClient();
      if (client == null) {
        throw new ValidationResponseException(INVALID_GRANT_CLIENT_CREDENTIALS);
      }
     
      // And the client must be allowed to perform this grant type
      if (!client.isAllowedClientCredentials()) {
        accessTokenRequest.setClient(null);
        throw new ValidationResponseException(CLIENT_CREDENTIALS_NOT_PERMITTED);
      }
    }
  }
View Full Code Here

TOP

Related Classes of org.surfnet.oaaas.model.Client

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.