PHP code example of notakey / simplesamlphp-module-notakey

1. Go to this page and download the library: Download notakey/simplesamlphp-module-notakey 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/ */

    

notakey / simplesamlphp-module-notakey example snippets


'notakey-auth' => array(
    'notakey:Process',
    // if username remember me is enabled
    // remove domain from username when remembering
    "attrs.stripdomain" =>  false,
    // the attribute to populate username
    "user_id.attr" =>  "uid",
    // enable additional logging
    "debug" =>  true,
    // multiple endpints are possible (Notakey services)
    // user will have option to select one during authentication
    'endpoints' => array(
        array(
            'name' => 'Notakey service 1',
            'url' => 'https://api.mydomain.com/',
            'service_id' => '8c0b4f63-c1e9-4d1c-990e-12312312312',
            'client_id' => 'api-client-id',
            'client_secret' => 'client-secret',
            'service_logo' => '/userlogos/8c0b4f63-c1e9-4d1c-990e-8fc72740791c.png',
            // if using authentication profile, specify it here
            "profile_id" => "1231231-c1e9-4d1c-990e-12312312312",
            // Source name from authsources
            "stepup-source" =>  "ntk-radius",
            // Valid for 1 year
            "stepup-duration" => "P1Y"
        ),
        array(
            'name' => 'Notakey service 2',
            'url' => 'https://api.mydomain.com/',
            'service_id' => '8c0b4f63-c1e9-4d1c-990e-892746367623',
            'client_id' => 'api-client-id',
            'client_secret' => 'client-secret',
            'service_logo' => '/userlogos/8c0b4f63-c1e9-4d1c-990e-8fc72740791c.png'
        )
    )
)

"authproc.idp" => array(
    "90" => array(
        "class" => "notakey:Filter",
        "user_id.attr" => "uid",
        "debug" => true,
        "endpoints" => [
            array(
                'name' => 'Notakey service 1',
                'url' => 'https://api.mydomain.com/',
                'service_id' => '8c0b4f63-c1e9-4d1c-990e-12312312312',
                'client_id' => 'api-client-id',
                'client_secret' => 'client-secret',
                'service_logo' => '/userlogos/8c0b4f63-c1e9-4d1c-990e-8fc72740791c.png'
            )
        ]
    )
)