Sanji Auth UI is a core component of the Sanji UI framework, specifically designed for seamless integration within AngularJS 1.x applications. It provides robust authentication and authorization services, leveraging JSON Web Tokens (JWT) for secure user identification and session management. The package includes an `auth` service for handling login requests and a `session` service for storing and retrieving authenticated user data. Its current stable version is `1.4.0`, released in September 2018, indicating an infrequent and likely discontinued release cadence. A key differentiator is its tight coupling with the AngularJS 1.x ecosystem (specifically versions 1.5.0 to 1.6.x), making it unsuitable for modern Angular or other contemporary frontend frameworks. It also relies on specific versions of `angular-http-auth`, `angular-storage`, and `sanji-rest-ui` as peer dependencies.
npm install sanji-auth-uiVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to include the `sanji.auth` AngularJS module, inject the `auth` and `session` services into a controller, perform a user login with credential handling, and configure the `authProvider` and `sessionProvider`.
For modern applications, use a dedicated authentication solution designed for your current frontend framework (e.g., Auth0, Firebase Auth, or a custom JWT implementation for Angular/React/Vue).
Strongly consider migrating to an actively maintained authentication library to ensure ongoing security, compatibility, and support.
Ensure all peer dependencies are installed and match the specified version ranges. If using newer npm/yarn versions, you might need to use `--legacy-peer-deps` for installation, but proceed with caution as this can mask underlying compatibility issues.
Ensure `'sanji.auth'` is explicitly listed in your `angular.module()` dependencies: `angular.module('yourApp', ['sanji.auth'])`.Verify that the `sanji-auth-ui` script is loaded *before* your AngularJS application code in your HTML, and that `sanji.auth` is correctly added as a dependency to your AngularJS application module.
Ensure `angular.js` (or `angular.min.js`) is loaded as the very first script in your HTML `<head>` or `<body>` before `sanji-auth-ui` or any other AngularJS-related scripts.