Example usage for org.springframework.security.oauth2.common AuthenticationScheme query

List of usage examples for org.springframework.security.oauth2.common AuthenticationScheme query

Introduction

In this page you can find the example usage for org.springframework.security.oauth2.common AuthenticationScheme query.

Prototype

AuthenticationScheme query

To view the source code for org.springframework.security.oauth2.common AuthenticationScheme query.

Click Source Link

Document

Send a query parameter in the URI.

Usage

From source file:org.cloudfoundry.identity.uaa.social.OAuth2ClientAuthenticationFilterTests.java

@Test
public void testFacebookAuthentication() throws Exception {
    AuthorizationCodeResourceDetails resource = new AuthorizationCodeResourceDetails();
    resource.setAuthenticationScheme(AuthenticationScheme.query);
    OAuth2RestTemplate restTemplate = new OAuth2RestTemplate(resource, context);
    setUpContext("facebook.token");
    filter.setRestTemplate(restTemplate);
    filter.setUserInfoUrl("https://graph.facebook.com/me");
    filter.afterPropertiesSet();// w  ww .  j  ava 2  s  . c o  m
    SocialClientUserDetails user = filter.getUserDetails();
    assertTrue(!user.getAuthorities().isEmpty());
}

From source file:org.cloudfoundry.identity.uaa.client.OAuth2ClientAuthenticationFilterTests.java

@Test
public void testFacebookAuthentication() throws Exception {
    AuthorizationCodeResourceDetails resource = new AuthorizationCodeResourceDetails();
    resource.setAuthenticationScheme(AuthenticationScheme.query);
    OAuth2RestTemplate restTemplate = new OAuth2RestTemplate(resource, context);
    setUpContext("facebook.token");
    filter.setRestTemplate(restTemplate);
    filter.setUserInfoUrl("https://graph.facebook.com/me");
    filter.afterPropertiesSet();/* w w w .jav  a  2 s.c  om*/
    SocialClientUserDetails user = (SocialClientUserDetails) filter.getPrincipal();
    assertTrue(!user.getAuthorities().isEmpty());
}