Fix: add client_id to OAuth2 access tokens.

This commit is contained in:
Max Goodman
2012-03-15 13:23:04 -07:00
committed by Logan Hanks
parent 09c60ba42d
commit b94978a647
2 changed files with 3 additions and 2 deletions

View File

@@ -186,7 +186,7 @@ class OAuth2AccessController(MinimalController):
if not c.errors:
auth_token = OAuth2AuthorizationCode.use_token(code, c.oauth2_client._id, redirect_uri)
if auth_token:
access_token = OAuth2AccessToken._new(auth_token.user_id, auth_token.scope)
access_token = OAuth2AccessToken._new(auth_token.client_id, auth_token.user_id, auth_token.scope)
resp["access_token"] = access_token._id
resp["token_type"] = access_token.token_type
resp["expires_in"] = access_token._ttl

View File

@@ -276,9 +276,10 @@ class OAuth2AccessToken(Token):
_connection_pool = "main"
@classmethod
def _new(cls, user_id, scope_list):
def _new(cls, client_id, user_id, scope_list):
scope = ','.join(scope_list)
return super(OAuth2AccessToken, cls)._new(
client_id=client_id,
user_id=user_id,
scope=scope)