php-oauth
php-oauth copied to clipboard
Add ability to integrate with client-side authentication
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));
Good idea, thank you