Open Journal Systems
3.3.0
BasicAuth.php
1
<?php
2
3
namespace
Http\Message\Authentication
;
4
5
use
Http\Message\Authentication
;
6
use
Psr\Http\Message\RequestInterface
;
7
13
final
class
BasicAuth
implements
Authentication
14
{
18
private
$username;
19
23
private
$password;
24
29
public
function
__construct
($username, $password)
30
{
31
$this->username = $username;
32
$this->password = $password;
33
}
34
38
public
function
authenticate
(
RequestInterface
$request)
39
{
40
$header = sprintf(
'Basic %s'
, base64_encode(sprintf(
'%s:%s'
, $this->username, $this->password)));
41
42
return
$request->
withHeader
(
'Authorization'
, $header);
43
}
44
}
Http\Message\Authentication\BasicAuth
Definition:
BasicAuth.php:13
Http\Message\Authentication
Definition:
AutoBasicAuth.php:3
Psr\Http\Message\RequestInterface
Definition:
vendor/psr/http-message/src/RequestInterface.php:24
Http\Message\Authentication
Definition:
Authentication.php:12
Psr\Http\Message\MessageInterface\withHeader
withHeader($name, $value)
Http\Message\Authentication\BasicAuth\__construct
__construct($username, $password)
Definition:
BasicAuth.php:35
Http\Message\Authentication\BasicAuth\authenticate
authenticate(RequestInterface $request)
Definition:
BasicAuth.php:44
plugins
paymethod
paypal
vendor
php-http
message
src
Authentication
BasicAuth.php
Generated on Fri Aug 28 2020 14:50:52 for Open Journal Systems by
1.8.17