Log in Register

Log in

Shruthi Sharma
Monday, February 15 2016, 07:07 AM
I have the API. Please lemme know how can I add Google sign In button in my JSP Page.
Please help!
Responses (1)
  • Accepted Answer

    Tuesday, February 16 2016, 06:00 AM - #Permalink
    1. Go to the Google Developer Console.

    2. Select a project or Create a new one by selecting Create a project from your project list.

    3. In the Project name field, type in a name for your project.

    4. Your Project ID is created by the console for you.

    5. Click the Create button and wait for the project to be created.

    6. In the sidebar under "APIs & auth", select Credentials, and click the OAuth consent screen tab.

    7. Choose an Email Address, specify a Product Name, and click Save.

    8. In the sidebar under "APIs & auth", select Credentials.

    9. Click Create a new Client ID — a dialog box appears.

    10. Register the origins from which your app is allowed to access the Google APIs, as follows. An origin is a unique combination of protocol, hostname, and port.

    11. In the Application type section of the dialog, select Web application.

    12. In the Authorized JavaScript origins field, enter the origin for your app. You can enter multiple origins to allow for your app to run on different protocols, domains, or subdomains. Wildcards are not allowed. In the example below, the second URL could be a production URL.


    13. In the Authorized redirect URI field, delete the default value. Redirect URIs are not used with JavaScript APIs.

    14. Click the Create Client ID button.

    15. In the resulting Client ID for web application section, copy the Client ID that your app will need to use to access the APIs.

    Integrating Google Sign-In into your web app

    Load the Google Platform Library

    1. You must include the Google Platform Library on your web pages that integrate Google Sign-In.

    2. Specify your app's client ID

    Specify the client ID you created for your app in the Google Developers Console with the google-signin-client_id meta element.

    3. Add a Google Sign-In button

    To create a contextual Google Sign-In button that uses the default settings, add a div element with the class g-signin2 to your sign-in page.
    The reply is currently minimized Show
Your Reply