Skip to content

OAuth2 provider that requires basic authorization to get access token #70

Closed
@gianlucagiorgolo

Description

@gianlucagiorgolo

After trying to get django-all-access to work with the OAuth2 server of FIWARE lab, I found out that it was expecting an Authorization key in the header of the POST request that gets the access token (I was getting a 405 error). I managed to get it working by passing the following header to the request made in get_access_token in OAuth2Client:

headers = {'Authorization' : 'Basic ' + base64.b64encode(str(self.provider.consumer_key) + ':' + str(self.provider.consumer_secret))}
response = self.request('post', self.provider.access_token_url, data=args, headers=headers)

Not sure how it would be the best way to patch the code to make it more general (I have no idea if this may cause problems with other providers or if more kinds of authorizations should be included). I hope this helps.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions