0

I have php application build in Laravel and hosted it in a server.

I have also created a (G-suit) google admin account(https://admin.google.com) with my domainname(http://www.example.com) as a admin i have created few users (abc@myhost.com, xyz@myhost.com) from the google admin console.

Now Instead of creating a full authentication system in my application, What i want is that my users can login to my php application with the email address that i have created for them as admin.

How can i do this ?

Selvesan Malakar
  • 511
  • 2
  • 7
  • 20

2 Answers2

1

You could integrate 'simpleSAMLphp' (https://simplesamlphp.org/docs/stable/simplesamlphp-sp) into your app. Then your app will act as a SAMLv2 ServiceProvider and will consume SAMLv2 assertions issued by Google SAMLv2 IdP (https://support.google.com/a/answer/6087519?hl=en). There are also other PHP-based SP-implementations available, or you could use SAML SP Apache http server module if you are using Apache http server.

Bernhard Thalmayr
  • 2,674
  • 1
  • 11
  • 7
  • thankyou for your response. I am very new to the concept of saml therefor had to idea that i had to convert my application to sp. Now after reading your answer i am going to do so using the library that i will find (eg: onelogin, simplesamlphp etc). i will comment here if i have any problem to do so. – Selvesan Malakar Feb 01 '17 at 06:14
0

You may check this documentation about user accounts. It says that to create a user account using one of your domains, use the following POST request and include the authorization described in Authorize requests.

POST https://www.googleapis.com/admin/directory/v1/users

You may check on this example.

abielita
  • 13,147
  • 2
  • 17
  • 59