Nagendraveer Posted September 10, 2019 Share Posted September 10, 2019 (edited) 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 September 11, 2019 by cyberRobot Removed image Quote Link to comment Share on other sites More sharing options...
NotionCommotion Posted September 11, 2019 Share Posted September 11, 2019 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'] } Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.