ids/login

IDS authentication package

Maintainers

Package info

repo.fnbpos.net/ids/ids-login

pkg:composer/ids/login

Statistics

Installs: 643

Dependents: 0

Suggesters: 0


README

Laravel authentication package for IDS (Identity Service). Provides login, registration, QR code authentication, account management, and UI customization — all backed by the IDS API.

Requires: PHP 8.2+ | Laravel 11 or 12

Installation

composer require ids/login

Then run the interactive setup wizard:

php artisan ids:install

This will prompt you for your IDS credentials, feature preferences, and automatically configure your .env, publish config/migrations/assets, and run migrations.

Manual Installation

If you prefer manual setup:

# Publish config
php artisan vendor:publish --tag=ids-login-config

# Publish migrations
php artisan vendor:publish --tag=ids-login-migrations

# Publish assets (CSS, JS, phone input plugin)
php artisan vendor:publish --tag=ids-login-assets

# Run migrations
php artisan migrate

Configuration

After installation, configure via .env:

# Required
IDS_HOST=https://your-ids-server.com
IDS_UDID=your-udid
IDS_PASSWORD_CLIENT_ID=your-client-id
IDS_PASSWORD_SECRET=your-client-secret
IDS_CLIENT_CREDENTIAL_CLIENT_ID=your-cc-client-id
IDS_CLIENT_CREDENTIAL_SECRET=your-cc-secret
IDS_LOGIN_REDIRECT_TO=/home

# Feature Flags (all optional)
IDS_QR_LOGIN_ENABLED=true
IDS_ACCOUNT_ENABLED=true
IDS_USE_LIVEWIRE=false
IDS_RECAPTCHA_ENABLED=false
IDS_LOGIN_RESTRICTED=false
IDS_LOGIN_ALLOW_LOCAL_AUTH=false

# QR Login (required if QR enabled)
IDS_QR_REDIRECT_ID=your-redirect-id
PUSHER_APP_ID=
PUSHER_APP_KEY=
PUSHER_APP_SECRET=
PUSHER_APP_CLUSTER=ap1

# Recaptcha (required if recaptcha enabled)
RECAPTCHA_SITE_KEY=
RECAPTCHA_SECRET_KEY=

Full configuration reference: config/ids-login.php

Features

Authentication

  • Password login via IDS OAuth (password grant)
  • QR code login via Pusher real-time events (toggleable)
  • Local auth fallback when IDS server is unreachable
  • Phone verification post-login flow
  • Registration with OTP verification
  • Password reset with OTP verification
  • Recaptcha support (toggleable)

Account Management (toggleable)

  • Update display name, email, phone, password, language, avatar
  • OTP verification for email and phone changes
  • Profile picture upload

UI Customization

  • Database-driven settings via /ids-settings
  • Custom logo, background, primary color, dark mode
  • Configurable layout alignment

Multi-Tenancy

Supports Stancl Tenancy with two modes:

# In config/ids-login.php
'tenancy' => [
    'enabled' => true,
    'mode' => 'multi_db',   // or 'single_db'
    'middleware' => ['tenant'],
],
  • multi_db — separate database per tenant (publish tenant migrations)
  • single_db — shared database with tenant_id column scoping

Views

Ships with Blade views (default) and optional Livewire components.

Blade (default)

Works out of the box. Vanilla JS, no jQuery. To customize:

php artisan vendor:publish --tag=ids-login-views

Livewire (opt-in)

Set IDS_USE_LIVEWIRE=true in .env. Requires livewire/livewire ^3.0:

composer require livewire/livewire

Components: ids-login-form, ids-register-form, ids-forgot-password-form, ids-account-manager

Routes

All routes are prefixed with ids.:

NameMethodURI
ids.loginGET/login
ids.login.submitPOST/login
ids.logoutPOST/logout
ids.registerGET/register
ids.register.submitPOST/register
ids.register.otpGET/register/otp
ids.register.verify-otpPOST/register/verify-otp
ids.password.requestGET/password/reset
ids.password.otpPOST/password/reset/otp
ids.password.resetPOST/password/reset
ids.phone.verifyGET/phone-verification
ids.qr.callbackPOST/qr-login/callback
ids.qr.statusGET/qr-login/status
ids.accountGET/my-account
ids.account.namePOST/account/name
ids.account.phonePOST/account/phone
ids.account.emailPOST/account/email
ids.account.passwordPOST/account/password
ids.account.languagePOST/account/language
ids.account.avatarPOST/account/avatar
ids.settingsGET/ids-settings
ids.settings.storePOST/ids-settings

QR and Account routes are only registered when their feature flags are enabled.

User Model

The package adds these columns to your users table:

ColumnTypeDescription
ids_idstringIDS system user ID
ids_hashstringEncrypted IDS identifier
phone_nostringFull phone number with country code (e.g. +60129718420)
country_codestringCountry code (e.g. +60)
country_phone_nostringLocal phone number without country code (e.g. 129718420)
is_activebooleanUser active status

Configure column mapping in config/ids-login.php under attributes if your column names differ.

Updating

composer update ids/login
php artisan ids:update

Translations

Supports English, Malay (ms), and Chinese (zh). Publish to customize:

php artisan vendor:publish --tag=ids-login-translations

Upgrading from v3

See the Migration Guide in the design spec.

Key breaking changes:

  • PHP 8.2+ required (was 8.1+)
  • Config keys restructured (run php artisan ids:install to regenerate)
  • Route names now prefixed with ids.
  • Account routes changed from /ajax/update/* to /account/*
  • jQuery removed — views use vanilla JS
  • All vplus references removed

License

Proprietary - IDS