Révision b71e8531
Ajouté par Serghei Mihai il y a environ 9 ans
ckanext/ozwillo_pyoidc/plugin.py | ||
---|---|---|
9 | 9 |
|
10 | 10 |
from pylons import config, request |
11 | 11 |
|
12 |
from oidc import OIDCClients |
|
12 |
import conf |
|
13 |
from oidc import create_client |
|
13 | 14 |
|
14 | 15 |
plugin_config_prefix = 'ckanext.ozwillo_pyoidc.' |
15 | 16 |
|
... | ... | |
51 | 52 |
global CLIENT |
52 | 53 |
if 'organization_id' in session: |
53 | 54 |
g = model.Group.get(session['organization_id']) |
54 |
conf.CLIENTS['ozwillo']['client_registration'].update({
|
|
55 |
conf.CLIENT['client_registration'].update({ |
|
55 | 56 |
'client_id': g._extras['client_id'].value, |
56 | 57 |
'client_secret': g._extras['client_secret'].value, |
57 | 58 |
'redirect_uris': [toolkit.url_for(host=request.host, |
... | ... | |
61 | 62 |
qualified=True)] |
62 | 63 |
}) |
63 | 64 |
log.info('registration info for organization "%s" set' % g.name) |
64 |
CLIENT = OIDCClients(conf)['ozwillo']
|
|
65 |
CLIENT = create_client(**conf.CLIENT)
|
|
65 | 66 |
url, ht_args = CLIENT.create_authn_request(session, conf.ACR_VALUES) |
66 | 67 |
if ht_args: |
67 | 68 |
toolkit.request.headers.update(ht_args) |
Formats disponibles : Unified diff
Client building refactored