When viewing the Authorizations table at /user/%user/oauth/authorizations, there are no tokens listed.
Steps to Reproduce
1. Create a new User
2. Go to /user/%user/oauth/consumer
3. Add a Consumer
4. Edit the Consumer at /user/%user/oauth/consumer
5. Click "Add Authorization"
6. Check Authorized and the appropriate Permissions
7. Click Save
8. Click "OAuth Authorizations" (/user/%user/oauth/authorizations)
Expected Result
The new Authorization is listed in a table here.
Observed Result
The table is empty.
The problem is with the oauth_common_token.type field. This tinyint field is used to track the type of token. There are two types: Request and Access. The Authorizations table is looking for Access tokens, but the Add Authorization form at /oauth/%user/oauth/consumer/%consumer/authorizations-add only adds Request tokens.
The DrupalOAuthToken object sets its type value to OAUTH_COMMON_TOKEN_TYPE_REQUEST (oauth/includes/DrupalOAuthToken.inc:6) and the submit handler for the Add Authorizations form (oauth_common_form_authorization_submit), does not change that value (oauth/oauth_common.authorizations.inc:210) before it is written (line 221)
This also prevents the token from being loaded by DrupalOAuthServer when authenticating requests from clients.
Comment | File | Size | Author |
---|---|---|---|
#3 | 1994506-3-oauth-empty_authorizations_table.patch | 4.23 KB | elliotttf |
Comments
Comment #1
ShadowMonster CreditAttribution: ShadowMonster commentedI just get same problem. Do not know if that correct but I just add:
in line 220 of file oauth_common.authorizations.inc just before
In my case maybe problem is with PostreSQL DB.
Comment #2
ShadowMonster CreditAttribution: ShadowMonster commentedForgot to write i made that in 3.x-dev
Comment #3
elliotttf CreditAttribution: elliotttf commentedI came across this same issue and a few other minor admin issues. Here's a patch that fixed it for me (against 7.x-3.x).
Comment #4
pcambraJust tested this and could reproduce the issue, the patch fixes it.