PHP Toolkit

Code Your PHP App to Provide SSO via OneLogin

You can use OneLogin’s open-source SAML toolkit for PHP to enable single sign-on (SSO) for your app via any identity provider that offers SAML authentication. Use this document to learn how to set up the SSO connection between your app and OneLogin, specifically. We’ll use the demo1 app (php-saml-master/demo1) delivered in the toolkit to demonstrate how to perform the setup tasks. The demo1 app is a simple app that demonstrates the SSO and single logout (SLO) flow enabled by the SAML toolkit. For important information about prerequisites and installing and developing an app with the SAML Toolkit for PHP, see OneLogin’s SAML PHP Toolkit. GitHub Note that the downloadable toolkit also includes documentation of the OneLogin SAML Toolkit PHP library. See /php-saml-master/docs/Saml2/index.html.

Task 1: Prepare demo1 files

  1. Download the [SAML Toolkit for PHP](https://github.com/onelogin/php-saml/archive/master.zip).
  2. Copy the entire `php-saml-master` folder into a location where its contents can be processed as PHP by your web server.
  3. Rename `settings_example.php` located in `php-saml-master/demo1` to `settings.php`.
## Task 2: Create an app connector in OneLogin Use the [SAML Test Connector (Advanced)](https://onelogin.service-now.com/support?id=kb_article&sys_id=c89fefdadb2310503de43e043996195a) connector to build an application connector for your app. For demo purposes, we'll build one for the `demo1` app. This app connector will provide you with SAML values that your app needs to communicate with OneLogin as an identity provider. It also provides a place for you to provide SAML values that OneLogin needs to communicate with your app as a service provider.