To be able to make API
calls on behalf of the user who granted access to django
app, I have done the following :
I have added the field below to the
UserAssociation
class in thedjango-authopenid
models (see link line 54) :data_access_token = models.CharField(max_length=255)
In the
complete_oauth1_signin
request in thedjango-authopenid
views (see link line 428) I have added :access_token_data = oauth._get_access_token_data()
(Note:
_get_access_token_data
is from theOAuthConnection
class in theutil.py
line 1005).and I have added:
return finalize_generic_signin( request=request, user=user, user_identifier=user_id, login_provider_name=oauth_provider_name, link_token=access_token_data, redirect_url=next_url)
In addition, in the
create_authenticated_user_account
in theviews.py
(see link line 118), I have added :UserAssociation( openid_url = user_identifier, user = user, provider_name = login_provider_name, data_access_token = link_token last_used_timestamp = timezone.now() ).save()
Please tell me what action shall I do to be able to store oauth
access token data.