Download the PHP package romichoirudin33/sso without Composer
On this page you can find all versions of the php package romichoirudin33/sso. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download romichoirudin33/sso
More information about romichoirudin33/sso
Files in romichoirudin33/sso
Package sso
Short Description this packages for OAuth2 for NTB Goverment
License MIT
Informations about the package sso
Single Sign On NTBPROV
Laravel wrapper OAuth 2 libraries to make support for (NTB Goverments).
Instalation
To get started SSO, use the Composer package manager to add the package to your project's dependencies:
after install composer, please insert SsoNtbServiceProvider
on config/app.php
then please insert config/services.php
and yey, finally you must insert that SSO_CLIENT in .env
example like this
For get environment SSO_CLIENT
you must register your application on https://sso.ntbprov.go.id.
If you don't have account DEVELOPER on https://sso.ntbprov.go.id, you can send email to [email protected] for get more information or contact us on https://layanan.diskominfotik.ntbprov.go.id/.
Authentication Using Laravel
Routing
To authenticate users using an OAuth provider, you will need two routes: one for redirecting the user to the OAuth provider, and another for receiving the callback from the provider after authentication. The example routes below demonstrate the implementation of both routes:
Authentication & Storage
Once the user has been retrieved from the OAuth provider, you may determine if the user exists in your application's database and authenticate the user. If the user does not exist in your application's database, you will typically create a new record in your database to represent the user:
User Details
After the user is redirected back to your application's authentication callback route, you may retrieve the user's details using Socialite's user method. The user object returned by the user method provides a variety of properties and methods you may use to store information about the user in your own database.
User Details (JSON)
#
Custom Authentication Using Laravel
Actually the application don't have register feature from user. Because some application have limit user to access. User can access just user that register from administrator. So if your application like this, you must custom authentication, example like this
Routes
Controllers
Views
But it's just example for using this package. You still need to adapt the code to your needs.
Custom Authentication Using CodeIgniter 3
HTTPClient Libraries
Please make libraries HTTPClient on application/libraries/HTTPClient.php
Controller
Don't forget to autoload libraries and helpers before make controller
So you can use this code for get data user, but if you have specific logic authentication you still need to adapt the code to your needs.
Supports Me
For next information about this package you can contact me on [email protected]