chillrend / pnj-socialite-provider
A Socialite Provider for PNJ SSO
Installs: 204
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/chillrend/pnj-socialite-provider
Requires
- php: ^7.2|^8.0
- ext-json: *
- socialiteproviders/manager: ^4.0
This package is auto-updated.
Last update: 2025-12-06 09:53:51 UTC
README
composer require chillrend/pnj-socialite-provider
Installation & Basic Usage
Please see the Base Installation Guide, then follow the provider specific instructions below.
Add configuration to config/services.php
'pnj' => [ 'client_id' => env('CLIENT_ID'), 'client_secret' => env('CLIENT_SECRET'), 'redirect' => env('REDIRECT_URI') ],
Add provider event listener
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', ], ];
Usage
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();
Returned User fields
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"
}