0

To be able to make API calls on behalf of the user who granted access to django app, I have done the following :

  1. I have added the field below to the UserAssociation class in the django-authopenid models (see link line 54) :

    data_access_token = models.CharField(max_length=255)
    
  2. In the complete_oauth1_signin request in the django-authopenid views (see link line 428) I have added :

    access_token_data = oauth._get_access_token_data()
    

    (Note: _get_access_token_data is from the OAuthConnection class in the util.py line 1005).

  3. 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)
    
  4. In addition, in the create_authenticated_user_account in the views.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.

Ralf
  • 16,086
  • 4
  • 44
  • 68
novis
  • 15
  • 6
  • after the oauth flow processing, the openid_url is saved in the user association table but the access token data is not stored in this table – novis Aug 13 '18 at 16:36
  • @ironfroggy do you have this customization of django-authopenid? – novis Aug 14 '18 at 11:39

0 Answers0