composer require chillrend/pnj-socialite-providerPlease see the Base Installation Guide, then follow the provider specific instructions below.
'pnj' => [
'client_id' => env('CLIENT_ID'),
'client_secret' => env('CLIENT_SECRET'),
'redirect' => env('REDIRECT_URI')
],Configure the package's listener to listen for SocialiteWasCalled events.
Add the event to your listen[] array in app/Providers/EventServiceProvider. See the Base Installation Guide for detailed instructions.
protected $listen = [
\SocialiteProviders\Manager\SocialiteWasCalled::class => [
// ... other providers
'SocialiteProviders\\PNJ\\PNJExtendSocialite@handle',
],
];You should now be able to use the provider like you would regularly use Socialite (assuming you have the facade installed):
return Socialite::driver('pnj')->redirect();subthe system internal ID of a useridentthe user's internal identification number (can be a NIP (Nomor Induk Pegawai) or NIM (Nomor Induk Mahasiswa) depends on the access level of the user)namethe user's full nameemailthe user's email addressaddressthe user's home addressdate_of_birththe user's date of birthdepartment_and_levelthe user's access level and the user's department (in array)access_levelthe user's access level in a departmentaccess_level_namethe 'human readable' representation of the access leveldepartmentthe user's departmentdepartment_short_namethe department short abbreviation or name
JSON Representative of the user fields
{
"address": "187 Justen Point Suite 090\nWest Shania, TX 99746-9546",
"date_of_birth": "1979-03-14",
"department_and_level": [
{
"access_level": 99,
"access_level_name": "Admin",
"department": "Teknik Informatika dan Komputer",
"department_short_name": "TIK"
}
],
"email": "wilkinson.marquise@example.com",
"iat": 1622287930,
"ident": 80779,
"name": "Prof. Ivory Ferry",
"sub": "4"
}