Link to home
Start Free TrialLog in
Avatar of Anand Majmundar
Anand MajmundarFlag for India

asked on

How and where to issue GET request to procure URL for use in Google OAuth Button Click event

Attempting to code click event handler for "Login with Google" button in .NET 4.5 Web Application. The code would read something as follows:

$('#btnGoogleLogin').click(function () {

    window.location.href = "/api/Account/ExternalLogin?provider=Google&response_type=token&client_id=self&redirect_uri=http%3a%2f%2flocalhost%3a61358%2fLogin.html&state=GerGr5JlYx4t_KpsK57GFSxVueteyBunu02xJTak5m01";


Notice when we click the button we are redirecting the user to /api/Account/ExternalLogin. 

To get this URL, we need to issue a GET request to api/Account/ExternalLogins.

The question is how to issue this GET request and where?

Avatar of David Johnson, CD
David Johnson, CD
Flag of Canada image

Are you using the newest API  .. have you looked at the code generator?
Avatar of Anand Majmundar


Got code from the suggested link:

<div id="g_id_onload"

<div class="g_id_signin"

Where to get code for the defined class in the div?

Thank you.
In itself, pasting above code in aspx displays nothing.
Added the following:

 <script src="" async defer></script>

as directed in:

Yet, no button display.
Avatar of Anand Majmundar
Anand Majmundar
Flag of India image

Link to home
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial