Package org.surfnet.oaaas.model

Examples of org.surfnet.oaaas.model.AccessTokenRequest


    assertEquals(uri, determinedUri);
  }

  @Test
  public void testClientCredentialsTokenRequest() {
    AccessTokenRequest accessTokenRequest = new AccessTokenRequest();
    accessTokenRequest.setGrantType(OAuth2Validator.GRANT_TYPE_CLIENT_CREDENTIALS);
    accessTokenRequest.setClientId(client.getClientId());
    ValidationResponse response = validator.validate(accessTokenRequest,
        BasicAuthCredentials.createCredentialsFromHeader(null));
    assertEquals(ValidationResponse.CLIENT_CREDENTIALS_NOT_PERMITTED, response);
    assertNull(accessTokenRequest.getClient());

    client.setAllowedClientCredentials(true);
    response = validator.validate(accessTokenRequest,
        BasicAuthCredentials.createCredentialsFromHeader(null));
    assertEquals(ValidationResponse.VALID, response);
    assertEquals(client, accessTokenRequest.getClient());
  }
View Full Code Here


  @POST
  public Response revokeAccessToken(@HeaderParam("Authorization") String authorization,
                                    final MultivaluedMap<String, String> formParameters) {
    String accessToken;
    Client client;
    AccessTokenRequest accessTokenRequest = AccessTokenRequest.fromMultiValuedFormParameters(formParameters);
    BasicAuthCredentials credentials = getClientCredentials(authorization, accessTokenRequest);
    try {
      client = validateClient(credentials);
      List<String> params = formParameters.get("token");
      accessToken = CollectionUtils.isEmpty(params) ? null : params.get(0);
View Full Code Here

TOP

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

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.