Examples of OAuth2CallbackState


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

                  "OAuth2CallbackServlet requestStateKey is null.", "", null, resp, null);
        }
        return;
      }

      final OAuth2CallbackState state = new OAuth2CallbackState(this.stateCrypter,
              encRequestStateKey);

      accessor = this.store.getOAuth2Accessor(state);

      if (error != null) {
View Full Code Here

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

                  this.sendTraceToClient);
        }
        return;
      }

      final OAuth2CallbackState state = new OAuth2CallbackState(this.stateCrypter,
              encRequestStateKey);

      accessor = this.store.getOAuth2Accessor(state);

      if (error != null) {
View Full Code Here

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

    final String redirectUri = accessor.getRedirectUri();
    if (redirectUri != null && redirectUri.length() > 0) {
      queryParams.put(OAuth2Message.REDIRECT_URI, redirectUri);
    }

    final OAuth2CallbackState state = accessor.getState();
    if (state != null) {
      try {
        queryParams.put(OAuth2Message.STATE, state.getEncryptedState());
      } catch (final BlobCrypterException e) {
        throw new OAuth2RequestException(OAuth2Error.CODE_GRANT_PROBLEM, "encryption problem", e);
      }
    }
View Full Code Here

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

                  this.sendTraceToClient);
        }
        return;
      }

      final OAuth2CallbackState state = new OAuth2CallbackState(this.stateCrypter,
              encRequestStateKey);

      accessor = this.store.getOAuth2Accessor(state);

      if (error != null) {
View Full Code Here

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

  @Test
  public void testGetOAuth2Accessor_1() throws Exception {
    final OAuth2Accessor accessor = MockUtils.getOAuth2Accessor_Code();

    final OAuth2CallbackState state = new OAuth2CallbackState(MockUtils.getDummyStateCrypter());
    state.setGadgetUri(accessor.getGadgetUri());
    state.setServiceName(accessor.getServiceName());
    state.setUser(accessor.getUser());
    state.setScope(accessor.getScope());

    final OAuth2Accessor result = this.cache.getOAuth2Accessor(state);

    Assert.assertNotNull(result);
    Assert.assertEquals(MockUtils.CLIENT_ID1, result.getClientId());
View Full Code Here

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

    Assert.assertEquals(MockUtils.CLIENT_ID1, result.getClientId());
  }

  @Test
  public void testGetOAuth2Accessor_3() throws Exception {
    final OAuth2CallbackState state = new OAuth2CallbackState(MockUtils.getDummyStateCrypter());
    state.setGadgetUri("BAD");
    state.setServiceName("BAD");
    state.setUser("BAD");
    state.setScope("BAD");
    final OAuth2Accessor result = this.cache.getOAuth2Accessor(state);

    Assert.assertNull(result);
  }
View Full Code Here

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

    OAuth2Accessor accessor = new BasicOAuth2Accessor("XXX", "YYY", "ZZZ", "", false, store, "AAA",
            null, null);

    this.cache.storeOAuth2Accessor(accessor);

    final OAuth2CallbackState state = new OAuth2CallbackState(MockUtils.getDummyStateCrypter());
    state.setGadgetUri(accessor.getGadgetUri());
    state.setServiceName(accessor.getServiceName());
    state.setUser(accessor.getUser());
    state.setScope(accessor.getScope());
    accessor = this.cache.getOAuth2Accessor(state);

    Assert.assertNotNull(accessor);
    Assert.assertEquals("XXX", accessor.getGadgetUri());
    Assert.assertEquals("YYY", accessor.getServiceName());
View Full Code Here

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

    if (isLogging) {
      OSEOAuth2Store.LOG.entering(OSEOAuth2Store.LOG_CLASS, "getOAuth2Accessor", new Object[] {
          gadgetUri, serviceName, user, scope });
    }

    final OAuth2CallbackState state = new OAuth2CallbackState(this.stateCrypter);
    state.setGadgetUri(gadgetUri);
    state.setServiceName(serviceName);
    state.setUser(user);
    state.setScope(scope);

    OAuth2Accessor ret = this.cache.getOAuth2Accessor(state);

    if (ret == null || !ret.isValid()) {
      final OAuth2Client client = this.getClient(user, gadgetUri, serviceName);
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.