Jump to content
Nagendraveer

Login With Google

Recommended Posts

I developed a web app using PHP, Mysql. Now I want to give login access for Gmail id's which are already existed in my database, so I used login with Google API, but want to deny login access for any other gmails which do not exist in my database.?  So how can i do this?? currently iam using Google+ API For Login With Google & it is giving login access to everyone.

 

Edited by cyberRobot
Removed image

Share this post


Link to post
Share on other sites

I don't know how Google's login API works, but couldn't you just add the following logic to the entry point to your app?

<?php
if(empty($_SESSION['auth'])) {
  $email=$_POST['email'];	//or whatever
  //query DB.  If email doesn't exist, exit.  If email exists, set $_SESSION['auth']
}
  
  

 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.