Snorlax\Auth\BasicAuth::getCredentials PHP Method

getCredentials() public method

{@inheritDoc}
public getCredentials ( )
    public function getCredentials()
    {
        return base64_encode(sprintf('%s:%s', $this->user, $this->password));
    }

Usage Example

Example #1
0
 public function testBearerAuth()
 {
     $token = base64_encode('user:password');
     $auth = new BasicAuth('user', 'password');
     $this->assertSame($token, $auth->getCredentials());
     $this->assertSame('Basic', $auth->getAuthType());
 }