Componette

Componette

SiViN

SiViN / ntlm-http-auth

Extension for Nette Framework: NTLM authenticate for authenticator

download-cloud-line composer require sivin/ntlm-http-auth

License Total Downloads

NtlmHttpAuth

  1. Install via composer
composer require sivin/ntlm-http-auth
  1. Register extension in config.neon:
extensions:
	ntlmHttpAuth: SiViN\NtlmHttpAuth\DI\NtlmHttpAuthExtension

3, Tell which presenters should not be secured (in case no presenter name given, all presenters are secured). Format - Module:Presenter:

ntlmHttpAuth:
	excludedPresenters: [Front:Nonsecured] # Exlude presenter class App\FrontModule\Presenters\NonsecuredPresenter

4, Implement SiViN\NtlmHttpAuth\INtlmAuthenticator to your authenticator Inconfig.neon:

services:
	authenticator: NtlmAuthenticator

File NtlmAuthenticator.php:

class NtlmAuthenticator implements \Nette\Security\IAuthenticator, \SiViN\NtlmHttpAuth\INtlmAuthenticator
{
    function authenticate(array $credentials)
    {
        ...
    }

    function ntlmAuthenticate(\SiViN\NtlmHttpAuth\AuthenticateResult $authenticateResult)
    {
        if($this->LdapOrDbOrSomething($authenticateResult->username, $authenticateResult->domain, $authenticateResult->workstation))
        {
            return new \Nette\Security\Identity(...);
        }
        else
        {
            throw new \Nette\Security\AuthenticationException('User not found', self::IDENTITY_NOT_FOUND);
        }
    }
}

No release at this moment. Try to create first one.

bar-chart-fill

Statistics

download-cloud-fill
30
star-fill
0
bug-fill
0
flashlight-fill
3.5y
price-tag-2-line

Badges

guide-fill

Dependencies

Componette Componette felix@nette.org