Examples of GoogleAuthorizationRequestUrl


Examples of com.google.api.client.googleapis.auth.oauth2.draft10.GoogleAuthorizationRequestUrl

  @Override
  public void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException {
    String userEmail = user.getEmail();
    String originalRequest = requireParameter(req, "originalRequest");
    String authorizeUrl =
        new GoogleAuthorizationRequestUrl(clientId, callbackPath, oAuthScopes).build()
        // TODO(ohler): Find out if GoogleAuthorizationRequestUrl offers an API
        // to do this rather than appending the literal string.  Also consider
        // using server-side auto-approval rather than offline access ("perform
        // these operations when I'm not using the application") since that's
        // scary -- but import is meant to be able to run in the background over
View Full Code Here

Examples of com.google.api.client.googleapis.auth.oauth2.draft10.GoogleAuthorizationRequestUrl

  protected final Log logger = LogFactory.getLog(getClass());

  @RequestMapping(method = RequestMethod.GET)
  public void redirectToGoogle(HttpServletResponse response) {
    logger.info(redirectUrl + " - " + scope + " - " + clientId);
    String authorizationUrl = new GoogleAuthorizationRequestUrl(clientId,
        redirectUrl, scope).build();
    try {
      response.sendRedirect(authorizationUrl);
    } catch (IOException e) {
      e.printStackTrace();
View Full Code Here

Examples of com.google.api.client.googleapis.auth.oauth2.draft10.GoogleAuthorizationRequestUrl

   * manual http://code.google.com/apis/accounts/docs/OAuth2InstalledApp.html
   * example http://code.google.com/p/google-api-java-client/wiki/OAuth2Draft10
   */
  public void authorizeToGoogle() throws IOException {
    // Generate the URL to which we will direct users
    GoogleAuthorizationRequestUrl authUrl = new GoogleAuthorizationRequestUrl(
        clientId, AUTH_REDIRECT_URI, AUTH_RPC);
    String authorizeUrl = authUrl.build();
    System.out.println("Paste this URL in your browser:\n" + authorizeUrl);

    // Wait for the authorization code
    System.out.println("Type the code you received here: ");
    BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
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.