Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8585873
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T22:10:26+00:00 2026-06-11T22:10:26+00:00

I am lost in all my open browser tabs for Google single sign on

  • 0

I am lost in all my open browser tabs for Google single sign on 🙂

I already have an application which I would like to put on Google market place. And mandatory integration is Google SSO. I have built application on Struts2 with Spring.

So now I need some instructions how to make this integration. An example would be perfect. Or how to start, which technology to use, best approaches, anything similar…

Also, do I have to use Google App Engine for SSO integration or no? Honestly, I am confused 🙂

EDIT

I started here: developers.google.com/google-apps/marketplace/sso Because I use Java, if you look at Getting started at the bottom, I wanted to use step2, but the link is dead. From there on I got stuck…

Links here are also dead.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T22:10:27+00:00Added an answer on June 11, 2026 at 10:10 pm

    I made with Apache’s HttpClient. This is my solution and works perfectly for me.

    First point to authorization url:

    https://accounts.google.com/o/oauth2/auth?scope=https://www.googleapis.com/auth/userinfo.profile+https://www.googleapis.com/auth/userinfo.email&state=%2Fprofile&response_type=code&client_id=<YOUR_CLIENT_ID>&redirect_uri=<YOUR_CALLBACK_URL>

    Then get parameters back from your redirect_uri and build request body for getting access_token:

        String code =  request.getParameter("code");
        String foros = "code="+code +
                    "&client_id=<YOUR_CLIENT_ID>" +
                    "&client_secret=<YOUR_CLIENT_SECRET>" +
                    "&redirect_uri="+getText("google.auth.redirect.uri") +
                    "&grant_type=authorization_code";
    

    Then with HttpClient make a POST and with simple JSON parser parse out the access token.

        HttpClient client = new HttpClient();
        String url = "https://accounts.google.com/o/oauth2/token";
        PostMethod post = new PostMethod(url);
        post.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
    
        try {
            post.setRequestEntity(new StringRequestEntity(foros, null, null));
        } catch (UnsupportedEncodingException e) {
            throw new RuntimeException(e);
        }
        String accessToken = null;
        try {
            client.executeMethod(post);
            String resp = post.getResponseBodyAsString();
            JSONParser jsonParser = new JSONParser();
            Object obj = jsonParser.parse(resp);
            JSONObject parsed = (JSONObject)obj;            
            accessToken = (String) parsed.get("access_token");
        } catch (HttpException e) {
            throw new RuntimeException(e);
        } catch (IOException e) {
            throw new RuntimeException(e);
        } catch (ParseException e) {
            throw new RuntimeException(e);
        }
    

    Now you have the access token and you can now access all of the Google API. For example, getting all the users info:

        GetMethod getUserInfo = new GetMethod("https://www.googleapis.com/oauth2/v1/userinfo?access_token="+accessToken);
    
        String googleId = null;
        String email = null;
        String name = null;
        String firstName = null;
        String lastName = null;
        try {
            client.executeMethod(getUserInfo);
            String resp = getUserInfo.getResponseBodyAsString();
            JSONParser jsonParser = new JSONParser();
            Object obj = jsonParser.parse(resp);
            JSONObject parsed = (JSONObject)obj;
            googleId = (String) parsed.get("id");
            email = (String) parsed.get("email");
            name = (String) parsed.get("name");
            firstName = (String) parsed.get("given_name");
            lastName = (String) parsed.get("family_name");
        } catch (IOException e) {
            throw new RuntimeException(e);
        } catch (ParseException e) {
            throw new RuntimeException(e);
        }
    

    This data you can now save and use it for login to your application.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In my application I have a model and viewmodel which implement IDataError this all
I'm sort of lost on this. I have an application that is reading from
The Delphi application checks if a form instance is already open this way: form
I have a script which uses up all available connections of the locally running
I recently had a hard drive crashed and lost all of my source code.
I have lost the debug panel/toolbar (with the yellow curly arrow step tools) in
I have problem with streaming. When I send small file like 1kb txt everything
Our open source application is quite popular, and we are many developers. The app
all my problem is as follows: I have a page containing an addthis-button. Normally,
So in all my failed attempts to get jQueryUI working, I have tried this

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.