Skip to content

Commit

Permalink
Merge pull request #425 from rvegas/patch-1
Browse files Browse the repository at this point in the history
Change LinkedIn auth method to header
  • Loading branch information
elliotchance committed Oct 7, 2015
2 parents 4e710c2 + 2786138 commit 7d7d757
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/OAuth/OAuth2/Service/Linkedin.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public function getAccessTokenEndpoint()
*/
protected function getAuthorizationMethod()
{
return static::AUTHORIZATION_METHOD_QUERY_STRING_V2;
return static::AUTHORIZATION_METHOD_HEADER_BEARER;
}

/**
Expand Down
9 changes: 4 additions & 5 deletions tests/Unit/OAuth2/Service/LinkedinTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public function testGetAccessTokenEndpoint()
public function testGetAuthorizationMethod()
{
$client = $this->getMock('\\OAuth\\Common\\Http\\Client\\ClientInterface');
$client->expects($this->once())->method('retrieveResponse')->will($this->returnArgument(0));
$client->expects($this->once())->method('retrieveResponse')->will($this->returnArgument(2));

$token = $this->getMock('\\OAuth\\OAuth2\\Token\\TokenInterface');
$token->expects($this->once())->method('getEndOfLife')->will($this->returnValue(TokenInterface::EOL_NEVER_EXPIRES));
Expand All @@ -109,10 +109,9 @@ public function testGetAuthorizationMethod()
$storage
);

$uri = $service->request('https://pieterhordijk.com/my/awesome/path');
$absoluteUri = parse_url($uri->getAbsoluteUri());

$this->assertSame('oauth2_access_token=foo', $absoluteUri['query']);
$headers = $service->request('https://pieterhordijk.com/my/awesome/path');
$this->assertTrue(array_key_exists('Authorization', $headers));
$this->assertTrue(in_array('Bearer foo', $headers, true));
}

/**
Expand Down

0 comments on commit 7d7d757

Please sign in to comment.