Download the PHP package novay/smrpas without Composer

On this page you can find all versions of the php package novay/smrpas. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package smrpas

SMR-PAS (Samarinda Digital ID)

SMR-PAS is a Laravel package designed to integrate the Samarinda Digital ID single sign-on (SSO) system into your Laravel applications. It leverages Laravel Passport for OAuth-based authentication, allowing seamless and secure user authentication with the Samarinda Digital ID platform. This package simplifies the process of connecting your application to the SMR-PAS server, enabling users to log in using their Samarinda Digital ID credentials.

Requirements

To use the SMR-PAS package, ensure your application meets the following requirements:

How it works?

The SMR-PAS package integrates your application with the Samarinda Digital ID OAuth server. Here's how it works:

  1. OAuth Authorization: The package redirects users to the SMR-PAS OAuth server (https://smrpas.samarindakota.go.id) for authentication.
  2. User Consent: Users are prompted to log in and consent to share their identity details with your application (configurable via OAUTH_PROMPT).
  3. Token Exchange: Upon successful authentication, the SMR-PAS server redirects the user back to your application with an authorization code, which is exchanged for an access token.
  4. User Authentication: The access token is used to authenticate the user and retrieve their profile information, allowing seamless SSO integration.
  5. Redirect: After successful login, users are redirected to a configurable home route (e.g., /dashboard).

The package handles the OAuth flow, state validation, and token management, ensuring secure and efficient integration with the Samarinda Digital ID system.

Installation

IMAGE ALT TEXT

Follow these steps to install and configure the SMR-PAS package in your Laravel application:

1. Install the Package

Install the package using Composer:

The package uses Laravel's auto-discovery feature, so the Novay\Smrpas\SmrpasServiceProvider is automatically registered in your application.

2. Publish Vendor Assets

Publish the package's configuration files, migrations, and other assets:

This will copy the package’s configuration file (config/smrpas.php) and migrations to your application.

3. Run Migrations

The package includes database migrations to set up OAuth-related tables. We just need to target only the package’s migrations, run the migrations using:

4. Configure Environment Variables

Add the following environment variables to your .env file to configure the SMR-PAS OAuth integration:

Variable Descriptions:

5. Use Trait in User Model

To enable OAuth token management for users in your application, add the TokenTrait provided by the SMR-PAS package to your User model. This trait provides methods to handle OAuth tokens seamlessly. Update your User model (typically located at app/Models/User.php):

The TokenTrait adds functionality to manage OAuth access tokens, refresh tokens, and user authentication data retrieved from the SMR-PAS server.

6. Verify Configuration

Ensure the config/smrpas.php file (published in step 2) contains the correct settings, and update it if needed to match your .env values.

Usage

To enable users to log in via Samarinda Digital ID, add a "Sign in with SMR-PAS" link to your application:

This link triggers the OAuth authorization flow, redirecting users to the SMR-PAS server. After authentication, users are redirected back to your application’s callback URL (OAUTH_SERVER_REDIRECT_URI), and the package handles token exchange and user authentication. You can customize the redirect behavior or integrate additional logic by modifying the package’s routes or controllers (e.g., Novay\Smrpas\Http\Controllers\AuthController).

Credit

License

SMR-PAS for Laravel is licensed under the MIT License for both personal and commercial use. Enjoy!


All versions of smrpas with dependencies

PHP Build Version
Package Version
No informations.
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package novay/smrpas contains the following files

Loading the files please wait ....