auth-providers

Explains OrangeHRM's pluggable authentication provider chain, LDAP sync, OAuth2 server, and OIDC SSO integration.

Updated Jul 23, 2026
One-click install
npx skills add https://github.com/snow-gift111/orangehrm-ai-sdlc-capstone --skill auth-providers-snow-gift111
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: auth-providers
Source: https://github.com/snow-gift111/orangehrm-ai-sdlc-capstone/tree/main/.agents/skills/auth-providers
Command: npx skills add https://github.com/snow-gift111/orangehrm-ai-sdlc-capstone --skill auth-providers-snow-gift111

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Developers working on OrangeHRM need to understand how login attempts flow through the pluggable authentication provider chain, and how to add new providers, configure LDAP, register OAuth2 clients, or debug login failures without reading the entire codebase. ## Core Features & Use Cases - Provider chain reference: Documents AuthProviderChain, AbstractAuthProvider, priority ordering, and the false-vs-throw semantics that control fallthrough between providers. - Concrete provider coverage: Explains LocalAuthProvider (bcrypt password verification), LDAPAuthProvider (bind plus user sync via LDAPService/LDAPSyncService), the OAuth2 server (league/oauth2-server), and OIDC SSO (jumbojett/openid-connect-php). - Recipes and checklists: Step-by-step guides for adding a new auth provider, registering an OAuth2 client, configuring LDAP, and debugging "user can't log in" scenarios. - Use Case: When integrating a SAML provider, follow Recipe 1 to create an AbstractAuthProvider subclass with a unique priority and register it in the plugin's initialize() method. ## Quick Start Ask the agent to explain how OrangeHRM decides which authentication provider handles a login attempt and how to add a new one.

Frequently Asked Questions about auth-providers

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add a custom authentication provider in OrangeHRM?

Create a class extending AbstractAuthProvider that implements authenticate(AuthParams): bool and getPriority(): int, then register it in your plugin's PluginConfiguration initialize() method via $chain->addProvider(). Ensure the priority is unique, since the chain throws on conflicts.

How does OrangeHRM LDAP authentication and user sync work?

LDAPAuthProvider binds to the LDAP server via LDAPService, and on success LDAPSyncService creates or updates the local User row. Sync also runs hourly through the orangehrm:ldap-sync-user console command, and LDAP-only users have NULL user_password.

What is the difference between OAuth2 and OIDC in OrangeHRM?

The OAuth2 server (league/oauth2-server) issues tokens for third-party API access, not interactive login. The OpenID Connect plugin (jumbojett/openid-connect-php) handles interactive SSO login via providers like Google or Microsoft.

Why does a valid LDAP user fail to log in to OrangeHRM?

Check that LDAPAuthenticationPluginConfiguration registers the provider, that ldapSettings->isEnable() is true, and that the server is reachable from the host. Also verify the hourly sync has run or trigger orangehrm:ldap-sync-user manually.

When should authenticate() return false versus throw an exception?

Return false when the credentials belong to a different provider so the chain falls through to the next one. Throw AuthenticationException only when the provider itself is broken, such as an unreachable LDAP server, since the chain does not catch exceptions.