{"id":20460592,"url":"https://github.com/fawno/ntlmauthenticator","last_synced_at":"2026-03-01T04:04:35.666Z","repository":{"id":62549439,"uuid":"485567712","full_name":"fawno/NTLMAuthenticator","owner":"fawno","description":"NTLM Authenticator for CakePHP 4 Authentication plugin","archived":false,"fork":false,"pushed_at":"2025-02-18T21:08:16.000Z","size":7,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-18T22:02:52.571Z","etag":null,"topics":["authentication","authenticator","cakephp","cakephp-plugin","cakephp4","ntlm","ntlm-authentication"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fawno.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-04-25T23:33:30.000Z","updated_at":"2025-02-18T21:07:41.000Z","dependencies_parsed_at":"2022-11-03T01:15:36.578Z","dependency_job_id":null,"html_url":"https://github.com/fawno/NTLMAuthenticator","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fawno%2FNTLMAuthenticator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fawno%2FNTLMAuthenticator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fawno%2FNTLMAuthenticator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fawno%2FNTLMAuthenticator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fawno","download_url":"https://codeload.github.com/fawno/NTLMAuthenticator/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242016055,"owners_count":20058144,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["authentication","authenticator","cakephp","cakephp-plugin","cakephp4","ntlm","ntlm-authentication"],"created_at":"2024-11-15T12:20:36.869Z","updated_at":"2026-03-01T04:04:30.620Z","avatar_url":"https://github.com/fawno.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![GitHub license](https://img.shields.io/github/license/fawno/NTLMAuthenticator)](https://github.com/fawno/NTLMAuthenticator/blob/master/LICENSE)\n[![GitHub release](https://img.shields.io/github/release/fawno/NTLMAuthenticator)](https://github.com/fawno/NTLMAuthenticator/releases)\n[![Packagist](https://img.shields.io/packagist/v/fawno/ntlm-authentication)](https://packagist.org/packages/fawno/ntlm-authentication)\n[![Packagist Downloads](https://img.shields.io/packagist/dt/fawno/ntlm-authentication)](https://packagist.org/packages/fawno/ntlm-authentication/stats)\n[![GitHub issues](https://img.shields.io/github/issues/fawno/NTLMAuthenticator)](https://github.com/fawno/NTLMAuthenticator/issues)\n[![GitHub forks](https://img.shields.io/github/forks/fawno/NTLMAuthenticator)](https://github.com/fawno/NTLMAuthenticator/network)\n[![GitHub stars](https://img.shields.io/github/stars/fawno/NTLMAuthenticator)](https://github.com/fawno/NTLMAuthenticator/stargazers)\n\n# NTLM Authenticator for CakePHP 4 Authentication plugin\n\nThis plugin provides an NTLM Authenticator for CakePHP 4 authentication plugin.\n\n# Table of contents\n- [Requirements](#requirements)\n- [Installation](#installation)\n- [Configuration](#configuration)\n  - [Apache with SSPI NTLM based authentication module (mod_authn_ntlm)](#apache-with-sspi-ntlm-based-authentication-module-mod_authn_ntlm)\n  - [NTLMAuthenticator](#ntlmauthenticator)\n\n## Requirements\n\n- PHP \u003e= 7.2.0\n- Apache 2.4 SSPI NTLM based authentication module ([mod_authn_ntlm](https://github.com/TQsoft-GmbH/mod_authn_ntlm))\n- CakePHP \u003e= 4.3.0\n- [CakePHP Authentication](https://book.cakephp.org/authentication/2/en/index.html) \u003e= 2.0\n\nOptional:\n- ext-ldap ([LDAP php extension](https://www.php.net/manual/en/book.ldap.php))\n\n[TOC](#table-of-contents)\n\n## Installation\n\nInstall this plugin into your application using [composer](https://getcomposer.org):\n\n- Add `fawno/ntlm-authentication` package to your project:\n  ```bash\n    composer require fawno/ntlm-authentication\n  ```\n- Load the NTLMAuthenticator in your `Application.php`:\n  ```php\n  use Fawno\\NTLM\\Authenticator\\NTLMAuthenticator;\n  ```\n- Load the NTLMAuthenticator in your Authentication Service (`Application.php`):\n  ```php\n  // Load the authenticators. Session should be first.\n  $service-\u003eloadAuthenticator('Authentication.Session');\n\n  $service-\u003eloadAuthenticator(NTLMAuthenticator::class, [\n      'domains' =\u003e [],\n  ]);\n  ```\n\n[TOC](#table-of-contents)\n\n## Configuration\n\n`exampledomain` short domain name\n\n`example.com` full domain name\n\n### Apache with SSPI NTLM based authentication module ([mod_authn_ntlm](https://github.com/TQsoft-GmbH/mod_authn_ntlm))\n\nOnly routes with `/login` are authenticated with NTLM\n\n`webroot\\.htaccess`:\n```aconf\n\u003cIf \"%{THE_REQUEST} =~ m#GET .*/login(\\?.*)? HTTP.*#\"\u003e\n\tAuthName \"Example App\"\n\tAuthType SSPI\n\tNTLMAuth On\n\tNTLMAuthoritative On\n\tNTLMDomain exampledomain\n\tNTLMOmitDomain Off     # keep domain name in userid string\n\tNTLMOfferBasic On      # let non-IE clients authenticate\n\tNTLMBasicPreferred Off # should basic authentication have higher priority\n\tNTLMUsernameCase lower\n\tRequire valid-user\n\u003c/If\u003e\n\u003cElse\u003e\n\tAuthType None\n\tRequire all granted\n\u003c/Else\u003e\n\n#Order allow,deny\n#Allow from 192.168.0.0/16\nSatisfy all\n```\n\n[TOC](#table-of-contents)\n\n### NTLMAuthenticator\n\nNTLM Authenticator can query through LDAP for user membership. This information is stored in the session and can be used for authorization (ACL).\n\n```php\n$service-\u003eloadAuthenticator(NTLMAuthenticator::class, [\n    'domains' =\u003e [\n        'exampledomain' =\u003e [\n            'ldap' =\u003e [\n                'srv' =\u003e 'active-directory.example.com',\n                'user' =\u003e base64_encode('user@example.com'),\n                'pass' =\u003e base64_encode('UserPassword'),\n                'dn' =\u003e 'OU=Departaments, DC=example, DC=com',\n                'dn_users' =\u003e 'CN=Users, DC=example, DC=com',\n            ],\n            'config' =\u003e [\n                'some_key' =\u003e 'some_data',\n            ],\n        ],\n        'exampledomain2' =\u003e [\n            'ldap' =\u003e [\n                'srv' =\u003e 'active-directory.example2.com',\n                'user' =\u003e base64_encode('user@example2.com'),\n                'pass' =\u003e base64_encode('UserPassword2'),\n                'dn' =\u003e 'OU=Departaments, DC=example2, DC=com',\n                'dn_users' =\u003e 'CN=Users, DC=example2, DC=com',\n            ],\n            'config' =\u003e [\n                'some_key' =\u003e 'some_data',\n            ],\n        ],\n    ],\n]);\n```\nThe configured credentials should have query-only access to the LDAP service and no other privileges within the domain.\n\n`config` array is optional data can be stored in session auth data.\nIt allows configuring the logo of the organization and other data common to the users of a domain that the application needs to use.\n\nThe application does not have any access to validated user passwords, all NTLM authentication is negotiated between the Apache server and the browser.\n\n[TOC](#table-of-contents)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffawno%2Fntlmauthenticator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffawno%2Fntlmauthenticator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffawno%2Fntlmauthenticator/lists"}