mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-07 16:37:02 +03:00
24 lines
496 B
PHP
24 lines
496 B
PHP
<?php
|
|
/**
|
|
* https://datatracker.ietf.org/doc/html/rfc7628
|
|
* https://developers.google.com/gmail/imap/xoauth2-protocol
|
|
*/
|
|
|
|
namespace SnappyMail\SASL;
|
|
|
|
class XOAuth2 extends \SnappyMail\SASL
|
|
{
|
|
public function authenticate(string $username,
|
|
#[\SensitiveParameter]
|
|
string $passphrase,
|
|
?string $authzid = null
|
|
) : string
|
|
{
|
|
return $this->encode("user={$username}\x01auth=Bearer {$passphrase}\x01\x01");
|
|
}
|
|
|
|
public static function isSupported(string $param) : bool
|
|
{
|
|
return true;
|
|
}
|
|
}
|