php-oauth icon indicating copy to clipboard operation
php-oauth copied to clipboard

Add ability to integrate with client-side authentication

Open jesseweigert opened this issue 10 years ago • 1 comments

I have an API which needs to use the Authorization token passed in from a javascript client. The following code works, but it would be nice to have the php-oauth library handle this instead.

$headers = getallheaders();
if (!empty($headers))
{
    $authHeader = $headers['Authorization'];
}

list ($tokenType, $token) = explode(' ', $authHeader);
$storage->storeAccessToken(
  preg_replace('/^.*\\\\/', '', get_class($oAuthService)),
  new StdOAuth2Token($token));

jesseweigert avatar Jul 24 '15 19:07 jesseweigert

Good idea, thank you

logical-and avatar Jul 30 '15 20:07 logical-and