1 from json import loads, dumps
3 from oauthlib.common import add_params_to_uri, to_unicode
6 def linkedin_compliance_fix(session):
8 def _missing_token_type(r):
10 token['token_type'] = 'Bearer'
11 r._content = to_unicode(dumps(token)).encode('UTF-8')
14 def _non_compliant_param_name(url, headers, data):
15 token = [('oauth2_access_token', session._client.access_token)]
16 url = add_params_to_uri(url, token)
17 return url, headers, data
19 session._client.default_token_placement = 'query'
20 session.register_compliance_hook('access_token_response',
22 session.register_compliance_hook('protected_request',
23 _non_compliant_param_name)