Python apikey cookie (#2367)

* The `ApiClient` will now have support to store and use HTTP Cookies (as APIKey auth).

* Use Cookie authentication for user management.

* - Updated Python related samples.
This commit is contained in:
Tom Ghyselinck
2019-03-14 09:33:35 +01:00
committed by William Cheng
parent 33786e11f3
commit 83bc863b2b
14 changed files with 128 additions and 1 deletions

View File

@@ -523,6 +523,8 @@ class ApiClient(object):
if auth_setting:
if not auth_setting['value']:
continue
elif auth_setting['in'] == 'cookie':
headers['Cookie'] = auth_setting['value']
elif auth_setting['in'] == 'header':
headers[auth_setting['key']] = auth_setting['value']
elif auth_setting['in'] == 'query':

View File

@@ -218,7 +218,7 @@ class Configuration(six.with_metaclass(TypeWithDefault, object)):
'{{name}}':
{
'type': 'api_key',
'in': {{#isKeyInHeader}}'header'{{/isKeyInHeader}}{{#isKeyInQuery}}'query'{{/isKeyInQuery}},
'in': {{#isKeyInCookie}}'cookie'{{/isKeyInCookie}}{{#isKeyInHeader}}'header'{{/isKeyInHeader}}{{#isKeyInQuery}}'query'{{/isKeyInQuery}},
'key': '{{keyParamName}}',
'value': self.get_api_key_with_prefix('{{keyParamName}}')
},