hiidef / oauth2app

Django OAuth 2.0 Server App. Please fork and improve!
https://github.com/hiidef/oauth2app
MIT License
271 stars 115 forks source link

Fix issue when requesting token with grant_type client_credentials #22

Closed ckelly closed 12 years ago

ckelly commented 12 years ago

Came across an issue when requesting a token using the client_credentials grant_type.

Offending code was token.py, _get_client_credentials_token, line 412

Exception was "NoneType has no attribute "scope". Turns out when using client_credentials, the code was creating a new access_token object, but was trying to assign to self.access_token instead of the newly created in-scope object. I removed the references to self in the code.

Verified with new unit test GrantTypeTestCase.test_00_grant_type_client_credentials

bhagany commented 12 years ago

Looks good, thank you!