This guide will explain how to make your PHP Application become a JOSSO Partner Application.
The guide will be based on the provided JOSSO sample application.
- JOSSO Gateway configured and running (in any platform).
- JOSSO Agent configured in the selected platform. Take a look at Setup JOSSO Agent - PHP
- A Java Web Application, you can use the sample application distributed with JOSSO for testing purposes.
PHP Agent is found in josso-1.8.0.zip distribution only. You can download it here
The PHP Agent and a sample PHP application already jossified are distributed with JOSSO. Unzip the file josso-php-agent-1.8.0.zip located in the josso-1.8.0/dist/agents/src folder of JOSSO distribution. You will find the following structure:
Install JOSSO PHP pages in your application, copy the files located in josso-php-agent-1.8.0/josso-php-partnerapp/ to your application root directory:
We'll use JOSSO PHP sample partner application located in /var/www/php/php-partnerapp.
For Unix systems you can use :
For Win32 systems you can use :
Make sure to include the josso.php page in your application pages. If you used the prepend_file option the file will be automatically included by the PHP runtime.
|JOSSO Pages folder name|
Make sure the folder name you use matches the josso_agentBasecode variable defined in josso-inc.cfg file!
The sample application is also distributed with JOSSO and can be found at josso-1.8.0/dist/samples/apps/josso-partner-php-1.8.0-.zip
|JOSSO 1.8.2 and later|
From JOSSO 1.8.2 use $property['!name'] and $property['!value'] to access user properties.
Take a look at functions declared in josso.php file. You can use them to access user information, trigger the authentication process, obtain user roles, etc.
Check the sample partner application in the JOSSO distribution located in the src/webapp/samples/partnerappdirectory. Browse it online from our SVN repository here.