PHP code example of atmaliance / yii2-atm-keycloak

1. Go to this page and download the library: Download atmaliance/yii2-atm-keycloak 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/ */

    

atmaliance / yii2-atm-keycloak example snippets


return [
    'components' => [
        'keycloakService' => [
            'class' => atmaliance\yii2_keycloak\KeycloakService::class,
        ],
        'keycloakJwt' => [
            'class' => \sizeg\jwt\Jwt::class,
            'jwtValidationData' => atmaliance\yii2_keycloak\models\validator\KeycloakJwtValidator::class,
        ],
    ],
];

return [
    'components' => [
        'keycloakService' => [
            'baseUrl' => 'http://localhost:8180',
            'realm' => 'myRealm',
            'clientId' => 'myClientId',
            'clientSecret' => '6HB20p1vIw0tDB3uaaXxkxXs5l0JOgRu',
            'callbackUrl' => '/keycloak/auth/callback',
            'userInformationHandler' => new myUserInformationHandler(),
            'userInformationDTOClass' => myUserInformationDTOClass::class,
        ]
    ],
];

return [
    'bootstrap' => [
        \atmaliance\yii2_keycloak\bootstrap\KeycloakBootstrap::class,
    ],
    'modules' => [
        'atm-id' =>  [
            'class' => atmaliance\yii2_keycloak\modules\KeycloakModule::class
        ],
    ],
];

return [
    'keycloakEnabled' => true,
];