Package oauth2.thirdparty

Examples of oauth2.thirdparty.RestaurantReservationService


    @Override
    public Set<Object> getSingletons() {
        Set<Object> classes = new HashSet<Object>();
       
        ThirdPartyAccessService thirdPartyAccessService = new ThirdPartyAccessService();
        thirdPartyAccessService.setAccounts(accounts);
       
        classes.add(thirdPartyAccessService);
       
        OAuthRequestFilter filter = new OAuthRequestFilter();
        filter.setDataProvider(manager);
View Full Code Here


 
    @Override
    public Set<Object> getSingletons() {
        Set<Object> classes = new HashSet<Object>();
       
        ThirdPartyRegistrationService thirdPartyService = new ThirdPartyRegistrationService();
        thirdPartyService.setDataProvider(manager);
       
        AccessTokenService ats = new AccessTokenService();
        ats.setDataProvider(manager);
       
        classes.add(thirdPartyService);
View Full Code Here

        socialService.setAccounts(accounts);
       
        UserRegistrationService userRegService = new UserRegistrationService();
        userRegService.setAccounts(accounts);
       
        SecurityContextFilter scFilter = new SecurityContextFilter();
        scFilter.setAccounts(accounts);
       
        ThirdPartyAccessService thirdPartyAccessService = new ThirdPartyAccessService();
        thirdPartyAccessService.setAccounts(accounts);
       
        AuthorizationCodeGrantService authService = new AuthorizationCodeGrantService();
View Full Code Here

 
    @Override
    public Set<Object> getSingletons() {
        Set<Object> classes = new HashSet<Object>();
       
        SocialService socialService = new SocialService();
        socialService.setAccounts(accounts);
       
        UserRegistrationService userRegService = new UserRegistrationService();
        userRegService.setAccounts(accounts);
       
        SecurityContextFilter scFilter = new SecurityContextFilter();
View Full Code Here

 
  @GET
  public Calendar getUserCalendar() {
      OAuthContext oauth = getOAuthContext();
      String userName = oauth.getSubject().getLogin();
      UserAccount account = accounts.getAccount(userName);
      if (account == null) {
        account = accounts.getAccountWithAlias(userName);
      }
    return account.getCalendar();
  }
View Full Code Here

    private Server thirdPartySocialServer;
    private Server oauthServer;
   
    public void start() throws Exception {

      UserAccounts accounts = new UserAccounts();
      OAuthManager manager = new OAuthManager();
      SocialApplication socialApp = new SocialApplication();
      socialApp.setAccounts(accounts);
      socialApp.setOAuthManager(manager);
      socialServer = startApplication(socialApp);
View Full Code Here

        Set<Object> classes = new HashSet<Object>();
       
        SocialService socialService = new SocialService();
        socialService.setAccounts(accounts);
       
        UserRegistrationService userRegService = new UserRegistrationService();
        userRegService.setAccounts(accounts);
       
        SecurityContextFilter scFilter = new SecurityContextFilter();
        scFilter.setAccounts(accounts);
       
        ThirdPartyAccessService thirdPartyAccessService = new ThirdPartyAccessService();
View Full Code Here

          new RestaurantReservationService();
        WebClient socialService =
          WebClient.create("http://localhost:8080/thirdPartyAccess/calendar");
        reserveService.setSocialService(socialService);
       
        OAuthClientManager manager = new OAuthClientManager();
        manager.setAuthorizationURI("http://localhost:8080/social/authorize");
        WebClient ats =
          WebClient.create("http://localhost:8080/oauth/token");
        ats.accept(MediaType.APPLICATION_FORM_URLENCODED_TYPE);
        WebClient.getConfig(ats).getHttpConduit().getClient().setReceiveTimeout(1000000L);
        manager.setAccessTokenService(ats);
       
        reserveService.setOAuthClientManager(manager);
       
        SecurityContextFilter filter = new SecurityContextFilter();
        filter.setUsers(Collections.singletonMap("barry@restaurant.com", "5678"));
View Full Code Here

@ApplicationPath("/reservations")
public class RestaurantReserveApplication extends Application {
    @Override
    public Set<Object> getSingletons() {
        Set<Object> classes = new HashSet<Object>();
        RestaurantReservationService reserveService =
          new RestaurantReservationService();
        WebClient socialService =
          WebClient.create("http://localhost:8080/thirdPartyAccess/calendar");
        reserveService.setSocialService(socialService);
       
        OAuthClientManager manager = new OAuthClientManager();
        manager.setAuthorizationURI("http://localhost:8080/social/authorize");
        WebClient ats =
          WebClient.create("http://localhost:8080/oauth/token");
        ats.accept(MediaType.APPLICATION_FORM_URLENCODED_TYPE);
        WebClient.getConfig(ats).getHttpConduit().getClient().setReceiveTimeout(1000000L);
        manager.setAccessTokenService(ats);
       
        reserveService.setOAuthClientManager(manager);
       
        SecurityContextFilter filter = new SecurityContextFilter();
        filter.setUsers(Collections.singletonMap("barry@restaurant.com", "5678"));
       
        WebClient restaurantService =
          WebClient.create("http://localhost:8080/restaurant/reception");
        restaurantService.accept(MediaType.TEXT_PLAIN_TYPE).type(MediaType.APPLICATION_FORM_URLENCODED_TYPE);
        reserveService.setRestaurantService(restaurantService);
       
        classes.add(reserveService);
        classes.add(filter);
       
        return classes;
View Full Code Here

public class RestaurantApplication extends Application {
    @Override
    public Set<Object> getSingletons() {
        Set<Object> classes = new HashSet<Object>();
       
        classes.add(new RestaurantService());
       
        return classes;
    }
View Full Code Here

TOP

Related Classes of oauth2.thirdparty.RestaurantReservationService

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.