Revision c4dcef5d
Added by Serghei Mihai over 9 years ago
ckanext/ozwillo_pyoidc/plugin.py | ||
---|---|---|
1 | 1 |
import logging |
2 |
from routes import redirect_to |
|
2 | 3 |
|
3 | 4 |
import ckan.plugins as plugins |
4 | 5 |
import ckan.plugins.toolkit as toolkit |
... | ... | |
86 | 87 |
url, ht_args = client.create_authn_request(session, conf.ACR_VALUES) |
87 | 88 |
if ht_args: |
88 | 89 |
toolkit.request.headers.update(ht_args) |
89 |
toolkit.redirect_to(url)
|
|
90 |
redirect_to(url) |
|
90 | 91 |
else: |
91 |
toolkit.redirect_to('/')
|
|
92 |
redirect_to('/') |
|
92 | 93 |
|
93 | 94 |
def logout(self): |
94 | 95 |
log.info('Logging out user: %s' % session['user']) |
... | ... | |
102 | 103 |
id=g.name, |
103 | 104 |
qualified=True) |
104 | 105 |
|
105 |
toolkit.redirect_to(str(org_url))
|
|
106 |
redirect_to(str(org_url)) |
|
106 | 107 |
else: |
107 |
toolkit.redirect_to('/')
|
|
108 |
redirect_to('/') |
|
108 | 109 |
|
109 | 110 |
def update_config(self, config_): |
110 | 111 |
toolkit.add_template_directory(config_, 'templates') |
... | ... | |
122 | 123 |
controller='user', |
123 | 124 |
action='login', |
124 | 125 |
qualified=True) |
125 |
toolkit.redirect_to(login_url)
|
|
126 |
redirect_to(login_url) |
|
126 | 127 |
|
127 | 128 |
def callback(self): |
128 | 129 |
g = model.Group.get(session['organization_id']) |
... | ... | |
145 | 146 |
id=g.name, |
146 | 147 |
locale=userinfo.get('locale'), |
147 | 148 |
qualified=True) |
148 |
toolkit.redirect_to(str(org_url))
|
|
149 |
redirect_to(str(org_url)) |
|
149 | 150 |
|
150 | 151 |
def logout(self): |
151 | 152 |
toolkit.c.slo_url = toolkit.url_for(host=request.host, |
... | ... | |
182 | 183 |
# redirect to IDP logout |
183 | 184 |
logout_url += '?id_token_hint=%s&' % client.id_token |
184 | 185 |
logout_url += 'post_logout_redirect_uri=%s' % redirect_uri |
185 |
toolkit.redirect_to(logout_url) |
|
186 |
toolkit.redirect_to(org_url) |
|
186 |
redirect_to(logout_url) |
|
187 |
redirect_to(org_url) |
Also available in: Unified diff
using direct redirect method to avoid handling localized urls