PHP code example of antons / silverstripe-ssp

1. Go to this page and download the library: Download antons/silverstripe-ssp library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

antons / silverstripe-ssp example snippets

SESSID
SESSID

	if(!file_exists(BASE_PATH . '/simplesaml')) {
    	symlink(realpath(dirname(__FILE__)) . '../vendor/simplesamlphp/simplesamlphp/www', realpath(dirname(__FILE__)) . '/../simplesaml');
	}
	


class MySSPAuthenticator extends SSPAuthenticator {
	public function authenticate() {
		$attributes = $this->getAttributes();

		//Refer to example authenticators in /silverstripe-ssp/code/authenticators

		//SSPSecurity will handle the $member->login() so MySSPAuthenticator->authenticate() 
		//must return a SilverStripe Member object
		
		return $member;
	}
}