decode() public static method

Takes the header string and parses out the params needed for a digest authentication.
public static decode ( string $header ) : array
$header string
return array
Beispiel #1
0
 public function testDecode()
 {
     $header = 'qop="auth",nonce="4bca0fbca7bd0",' . 'nc="00000001",cnonce="95b2cd1e179bf5414e52ed62811481cf",' . 'uri="/http_auth",realm="app",' . 'opaque="d3fb67a7aa4d887ec4bf83040a820a46",username="******",' . 'response="04d7d878c67f289f37e553d2025e3a52"';
     $expected = array('qop' => 'auth', 'nonce' => '4bca0fbca7bd0', 'nc' => '00000001', 'cnonce' => '95b2cd1e179bf5414e52ed62811481cf', 'uri' => '/http_auth', 'realm' => 'app', 'opaque' => 'd3fb67a7aa4d887ec4bf83040a820a46', 'username' => 'gwoo', 'response' => '04d7d878c67f289f37e553d2025e3a52');
     $result = Auth::decode($header);
     $this->assertEqual($expected, $result);
 }