0

I have a nodejs application. In which I setup a google auth2 login system using passport js. I need to authenticate against a google app email id not a normal gmail id. Authentication is working fine. But it is not redirecting to the google app email login page (google.com/a/domain.com). It redirect to the gmail login page and from there I can login and authenticate by typing the full email id (username@domain.com). Is there any way to redirect to app engine login page so that I have only needed to type the username only.

Martijn Pieters
  • 1,048,767
  • 296
  • 4,058
  • 3,343
Rajeesh V
  • 402
  • 5
  • 19
  • Have you looked at the extra parameters Google accepts, as I explained with your [previous question](http://stackoverflow.com/questions/15543695/passportjs-authentication-using-google-apps-email-id/15544665#15544665)? I don't know if those will forward you to an app-specific page, though. – robertklep Mar 25 '13 at 13:21
  • That is not worked for me, I am restricting to my domain by explicitly checking the "hd" parameter value inside my code. The redirection also not working. – Rajeesh V Mar 26 '13 at 05:22

1 Answers1

0

I got the solution by editing this file

node_modules/passport-google-oauth/lib/passport-oauth/strategies/oauth2.js

I added a new line in line 164 below the following 2 lines params['response_type'] = 'code'; params['redirect_uri'] = callbackURL;

new line is given below params['hd'] = "domainname.com";

Now it is redirecting to the domain specific login page

Rajeesh V
  • 402
  • 5
  • 19