Package org.springframework.security.oauth.consumer.net

Examples of org.springframework.security.oauth.consumer.net.DefaultOAuthURLStreamHandlerFactory


   * tests getting a request token.
   */
  @Test
  public void testGetRequestToken() throws Exception {
    CoreOAuthConsumerSupport support = new CoreOAuthConsumerSupport();
    support.setStreamHandlerFactory(new DefaultOAuthURLStreamHandlerFactory());
    InMemoryProtectedResourceDetailsService service = new InMemoryProtectedResourceDetailsService();
    HashMap<String, ProtectedResourceDetails> detailsStore = new HashMap<String, ProtectedResourceDetails>();
    BaseProtectedResourceDetails googleDetails = new BaseProtectedResourceDetails();
    googleDetails.setRequestTokenURL("https://www.google.com/accounts/OAuthGetRequestToken");
    googleDetails.setAccessTokenURL("https://www.google.com/accounts/OAuthAuthorizeToken");
View Full Code Here


      public String getOAuthQueryString(ProtectedResourceDetails details, OAuthConsumerToken accessToken,
          URL url, String httpMethod, Map<String, String> additionalParameters) {
        return "POSTBODY";
      }
    };
    support.setStreamHandlerFactory(new DefaultOAuthURLStreamHandlerFactory());

    when(details.getAuthorizationHeaderRealm()).thenReturn("realm1");
    when(details.isAcceptsAuthorizationHeader()).thenReturn(true);
    when(details.getAdditionalRequestHeaders()).thenReturn(null);
    try {
View Full Code Here

      public String getOAuthQueryString(ProtectedResourceDetails details, OAuthConsumerToken accessToken,
          URL url, String httpMethod, Map<String, String> additionalParameters) {
        return "myquerystring";
      }
    };
    support.setStreamHandlerFactory(new DefaultOAuthURLStreamHandlerFactory());
    OAuthConsumerToken token = new OAuthConsumerToken();
    URL url = new URL("https://myhost.com/somepath?with=some&query=params&too");

    when(details.isAcceptsAuthorizationHeader()).thenReturn(true);
    assertEquals("https://myhost.com/somepath?with=some&query=params&too",
View Full Code Here

TOP

Related Classes of org.springframework.security.oauth.consumer.net.DefaultOAuthURLStreamHandlerFactory

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.