Add support for SASL Kerberous realms. Closes #114
This commit is contained in:
parent
cad0a11bd2
commit
673f070cb7
19
app/Classes/LDAP/Attribute/Password/SASL.php
Normal file
19
app/Classes/LDAP/Attribute/Password/SASL.php
Normal file
@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\LDAP\Attribute\Password;
|
||||
|
||||
final class SASL extends Base
|
||||
{
|
||||
public const key = 'SASL';
|
||||
|
||||
public function encode(string $password): string
|
||||
{
|
||||
if (! str_contains($password,'@'))
|
||||
return '';
|
||||
|
||||
// Ensure our id is lowercase, and realm is uppercase
|
||||
list($id,$realm) = explode('@',$password);
|
||||
|
||||
return sprintf('{%s}%s@%s',self::key,strtolower($id),strtoupper($realm));
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user