PHP code example of ifaniqbal / myits-oidc-laravel

1. Go to this page and download the library: Download ifaniqbal/myits-oidc-laravel 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/ */

    

ifaniqbal / myits-oidc-laravel example snippets


'providers' => [
    'Ifaniqbal\MyitsOidc\MyitsOidcServiceProvider',
];

'aliases' => [
    'MyitsOidc' => 'Ifaniqbal\MyitsOidc\Facades\MyitsOidc',
];

MYITS_OIDC_ID= # client ID
MYITS_OIDC_SECRET= # client secret
MYITS_OIDC_REDIRECT_PATH= # redirect path, default: /myits-sso
MYITS_OIDC_AUTH_ENDPOINT= # authorization endpoint, default: https://my.its.ac.id
MYITS_OIDC_SCOPE= # scope, default: 'profile role openid'
MYITS_OIDC_API_AUTH_ENDPOINT= # API auth endpoint, default: the value of MYITS_OIDC_AUTH_ENDPOINT
MYITS_OIDC_API_CLIENT_ID= # API client ID, default: the value of MYITS_OIDC_ID
MYITS_OIDC_API_CLIENT_SECRET= # API client secret, default: the value of MYITS_OIDC_SECRET


namespace App\Http\Controllers;

use Ifaniqbal\MyitsOidc\Facades\MyitsOidc;

class MyitsSsoController extends Controller
{
    public function index()
    {
        $oidc = MyitsOidc::authenticate();

        // $oidc->getIdToken();
        // $oidc->getAccessToken();
        // $oidc->requestUserInfo();
    }
}