Examples of OAuth2Accessor


Examples of net.oauth.v2.OAuth2Accessor

            if(userId == null){
              SampleOAuth2Provider.VALIDATOR.validateRequestMessageForAuthorization(requestMessage,client);
                sendToAuthorizePage(request, response, client);
            }
           
            OAuth2Accessor accessor = new OAuth2Accessor(client);           
           
            // set userId in accessor and mark it as authorized
            SampleOAuth2Provider.markAsAuthorized(accessor, userId);

View Full Code Here

Examples of net.oauth.v2.OAuth2Accessor

        String code = requestMessage.getCode();
        if(code == null){
          OAuth2ProblemException problem = new OAuth2ProblemException(OAuth2.ErrorCode.INVALID_REQUEST);
            throw problem;
        }
        OAuth2Accessor accessor = null;
        for (OAuth2Accessor a : SampleOAuth2Provider.ALL_TOKENS) {
            if(a.code != null) {
                if (a.code.equals(code)) {
                    accessor = a;
                    break;
View Full Code Here

Examples of net.oauth.v2.OAuth2Accessor

      String refreshToken = requestMessage.getParameter(OAuth2.REFRESH_TOKEN);
      if(refreshToken == null){
          OAuth2ProblemException problem = new OAuth2ProblemException(OAuth2.ErrorCode.INVALID_REQUEST);
            throw problem;
        }
      OAuth2Accessor accessor = null;
      for (OAuth2Accessor a : SampleOAuth2Provider.ALL_TOKENS) {
        if(a.refreshToken != null) {
          if (a.refreshToken.equals(refreshToken)) {
            accessor = a;
            break;
View Full Code Here

Examples of org.apache.shindig.gadgets.oauth2.OAuth2Accessor

  }

  @Test(expected = OAuth2RequestException.class)
  public void testGetAuthorizationRequest_1() throws Exception {
    final ClientCredentialsGrantTypeHandler fixture = ClientCredentialsGrantTypeHandlerTest.ccgth;
    final OAuth2Accessor accessor = null;

    final String completeAuthorizationUrl = "xxx";

    fixture.getAuthorizationRequest(accessor, completeAuthorizationUrl);
  }
View Full Code Here

Examples of org.apache.shindig.gadgets.oauth2.OAuth2Accessor

  }

  @Test(expected = OAuth2RequestException.class)
  public void testGetAuthorizationRequest_2() throws Exception {
    final ClientCredentialsGrantTypeHandler fixture = ClientCredentialsGrantTypeHandlerTest.ccgth;
    final OAuth2Accessor accessor = MockUtils.getOAuth2Accessor_Code();

    final String completeAuthorizationUrl = null;

    fixture.getAuthorizationRequest(accessor, completeAuthorizationUrl);
  }
View Full Code Here

Examples of org.apache.shindig.gadgets.oauth2.OAuth2Accessor

  }

  @Test(expected = OAuth2RequestException.class)
  public void testGetAuthorizationRequest_3() throws Exception {
    final ClientCredentialsGrantTypeHandler fixture = ClientCredentialsGrantTypeHandlerTest.ccgth;
    final OAuth2Accessor accessor = MockUtils.getOAuth2Accessor_Error();

    final String completeAuthorizationUrl = "xxx";

    fixture.getAuthorizationRequest(accessor, completeAuthorizationUrl);
  }
View Full Code Here

Examples of org.apache.shindig.gadgets.oauth2.OAuth2Accessor

  }

  @Test(expected = OAuth2RequestException.class)
  public void testGetAuthorizationRequest_4() throws Exception {
    final ClientCredentialsGrantTypeHandler fixture = ClientCredentialsGrantTypeHandlerTest.ccgth;
    final OAuth2Accessor accessor = MockUtils.getOAuth2Accessor_Code();
    final String completeAuthorizationUrl = "xxx";

    fixture.getAuthorizationRequest(accessor, completeAuthorizationUrl);
  }
View Full Code Here

Examples of org.apache.shindig.gadgets.oauth2.OAuth2Accessor

  }

  @Test
  public void testGetAuthorizationRequest_5() throws Exception {
    final ClientCredentialsGrantTypeHandler fixture = ClientCredentialsGrantTypeHandlerTest.ccgth;
    final OAuth2Accessor accessor = MockUtils.getOAuth2Accessor_ClientCredentials();
    final String completeAuthorizationUrl = "xxx";

    final HttpRequest result = fixture.getAuthorizationRequest(accessor, completeAuthorizationUrl);

    Assert.assertNotNull(result);
View Full Code Here

Examples of org.apache.shindig.gadgets.oauth2.OAuth2Accessor

  }

  @Test(expected = OAuth2RequestException.class)
  public void testGetCompleteUrl_1() throws Exception {
    final ClientCredentialsGrantTypeHandler fixture = ClientCredentialsGrantTypeHandlerTest.ccgth;
    final OAuth2Accessor accessor = null;
    fixture.getCompleteUrl(accessor);
  }
View Full Code Here

Examples of org.apache.shindig.gadgets.oauth2.OAuth2Accessor

  }

  @Test(expected = OAuth2RequestException.class)
  public void testGetCompleteUrl_2() throws Exception {
    final ClientCredentialsGrantTypeHandler fixture = ClientCredentialsGrantTypeHandlerTest.ccgth;
    final OAuth2Accessor accessor = MockUtils.getOAuth2Accessor_Error();
    fixture.getCompleteUrl(accessor);
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.