简体   繁体   English

php应用程序中的Google SAML APP SSO身份验证

[英]Google SAML APP SSO authentication in php application

I have php application build in Laravel and hosted it in a server. 我在Laravel中构建了php应用程序并将其托管在服务器中。

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. 我还以我的域名( http://www.example.com )创建了一个(G-suit)谷歌管理员帐户( https://admin.google.com )作为管理员,我已经创建了几个用户(abc @ myhost .com,xyz @ myhost.com)。

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. 现在,我不想在我的应用程序中创建完整的身份验证系统,而是希望我的用户可以使用为管理员创建的电子邮件地址登录我的php应用程序。

How can i do this ? 我怎样才能做到这一点 ?

You could integrate 'simpleSAMLphp' ( https://simplesamlphp.org/docs/stable/simplesamlphp-sp ) into your app. 您可以将'simpleSAMLphp'( https://simplesamlphp.org/docs/stable/simplesamlphp-sp )集成到您的应用程序中。 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 ). 然后,您的应用将充当SAMLv2 ServiceProvider,并将使用Google SAMLv2 IdP( https://support.google.com/a/answer/6087519?hl=zh_CN )发出的SAMLv2声明。 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. 还有其他基于PHP的SP实现,或者如果使用Apache http服务器,则可以使用SAML SP Apache http服务器模块。

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请求,并包括授权请求中所述的授权

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

You may check on this example . 您可以检查此示例

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM