@platform-x/hep-authentication-provider
v2.3.12
Published
Universal authentication provider supporting multiple platforms like Keycloak, Auth0, and more with a unified interface
Readme
Authentication Provider for Multiple Platforms
📦 Package Renamed: This package was previously published as
@platform-x/hep-keyclock-adapter. Please update your dependencies to use the new name.
A simplified, easy-to-use authentication manager supporting multiple authentication providers including Keycloak, with plans for Auth0, Azure AD, and Okta.
Installation
npm install @platform-x/hep-authentication-providerBasic Usage
import AuthenticationManager from '@platform-x/hep-authentication-provider';
// Initialize with provider and config - that's it!
const auth = new AuthenticationManager('sitename', 'Usertype');
auth.getUserList();Available Methods
All methods automatically handle access tokens internally - no manual token management needed!
validateUserPassword(username, password)- Validate user credentialscreateUser(userData, password)- Create new userupdateUser(userData)- Update existing userdeleteUser(userId)- Delete usergetUserList(args?)- Get list of users with optional search/paginationgetUserDetail(userId)- Get user by IDgetUserDetailByEmail(email)- Get user by emailvalidateUser(username)- Validate if user exists
Development
npm run build # Build the project
npm run build:watch # Watch for changes and rebuildSupported Providers
Currently supported authentication providers:
keycloak- Keycloak authentication server
Migration from Legacy
// New way (provider-based) import AuthenticationManager from '@platform-x/hep-authentication-provider'; const auth = new AuthenticationManager('sitename', 'Usertype');
All methods work the same way - plus automatic token management means you never have to worry about access tokens!
## Key Benefits
✅ **Automatic Token Management** - No need to handle access tokens manually
✅ **Provider-Based** - Easy to extend for other authentication providers
✅ **Simple API** - Just initialize and use - tokens handled internally
✅ **Error Resilient** - Built-in token refresh capabilities
✅ **Type Safe** - Full TypeScript support
✅ **Backward Compatible** - Existing code continues to work