Package net.oauth.v2.OAuth2

Examples of net.oauth.v2.OAuth2.Parameter


   
    newClient.setApplicationDescription(appDesc);
    newClient.setApplicationLogoUri(logoURI.toString());
    newClient.setRedirectUris(Collections.singletonList(appRedirectURI));
    manager.registerClient(newClient);
    return new ConsumerRegistration(clientId, clientSecret);
  }
View Full Code Here


    String clientSecret = generateClientSecret();
 
    Client newClient = new Client(clientId, clientSecret, true, appName, appURI);
    newClient.setRedirectUris(Collections.singletonList(appRedirectURI));
    manager.registerClient(newClient);
    return new ConsumerRegistration(clientId, clientSecret);
  }
View Full Code Here

      }
     
      WebClient finalClient = createClient(locationHeader2.toString(),
          "barry@restaurant.com", "5678");
      finalClient.accept("application/xml");
      ReservationConfirmation confirm = finalClient.get(ReservationConfirmation.class);
     
      if (confirm != null) {
        updateAndGetUserCalendar(7, "Dinner at " + confirm.getAddress());
      } else {
        System.out.println("Reservation failed");
      }
    }
View Full Code Here

           
            Response response = socialService.form(new Form().set("hour", request.getHour())
                                   .set("description", "Table reserved at " + address));
            boolean calendarUpdated = response.getStatus() == 200 || response.getStatus() == 204;
     
      return Response.ok(new ReservationConfirmation(address, request.getHour(), calendarUpdated))
                     .build();
    } else {
        return redirectToFailureHandler(CALENDAR_BUSY);
    }
    }
View Full Code Here

    @Produces({"text/html", "application/xml;q=0.9" })
    public ReservationFailure handleReservationFailure(@QueryParam("code") String errorCode) {
        LOG.info("Handling the reservation failure");
       
        String message = ERROR_DESCRIPTIONS.get(errorCode);
        return new ReservationFailure(message);
    }
View Full Code Here

                               @FormParam("password") String password) {
    if (accounts.getAccount(name) != null) {
      throw new WebApplicationException(400);
    }
    accounts.setAccount(name, new UserAccount(name, password, alias));
    return new UserRegistration(name);
  }
View Full Code Here

    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

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

    @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

TOP

Related Classes of net.oauth.v2.OAuth2.Parameter

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.