Download the PHP package accredifysg/singpass-login without Composer
On this page you can find all versions of the php package accredifysg/singpass-login. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download accredifysg/singpass-login
More information about accredifysg/singpass-login
Files in accredifysg/singpass-login
Package singpass-login
Short Description A Laravel package for integrating SingPass Login
License MIT
Homepage https://github.com/accredifysg/singpass-login
Informations about the package singpass-login
SingPass-Login
PHP Laravel Package for SingPass Login
Installation
You can install the package via composer:
Add the following variables to your .env
file.
Publish the config file
Optionally, you can publish the listener that will listen to the SingPassLoginEvent and log the user in
Usage and Customisations
Controllers and Routes
There are three default controllers that handle the login process
GetJwksEndpointController
exposes your application's JWKS endpoint to be registered with SingPass.
The default route for this controller is /sp/jwks
GetAuthenticationEndpointController
provides the authentication endpoint to redirect the client's browser to.
The default route for this controller is /sp/login
PostSingPassCallbackController
handles the callback from SingPass, and kick-starts the login process.
The default route for this controller is /sp/callback
If you prefer to set your own routes you can set SINGPASS_USE_DEFAULT_ROUTES
to false
,
then edit SINGPASS_JWKS_URL
, SINGPASS_CALLBACK_URL
, and SINGPASS_AUTHENTICATION_URL
in
your .env
file and map your own routes.
If you prefer to write your own controllers you can define them in the config file
singpass-login.php
as get_jwks_endpoint_controller
, post_singpass_callback_controller
and get_authentication_endpoint_controller
Listener
If you published the default listener, you should edit it and map your user retrieval via NRIC accordingly.
If you prefer to write your own, you can set SINGPASS_USE_DEFAULT_LISTENER
to false
in
your .env
and replace listener_class
in the config file singpass-login.php
Exceptions
All versions of singpass-login with dependencies
ext-gmp Version *
ext-json Version *
ext-openssl Version *
guzzlehttp/guzzle Version ^7.0
illuminate/contracts Version ^10.0||^11.0||^12.0
web-token/jwt-framework Version ^4.0.1
spomky-labs/aes-key-wrap Version ^7.0
symfony/clock Version ^7.0