Revision ae73cdc0 snf-pithos-app/pithos/api/util.py
b/snf-pithos-app/pithos/api/util.py | ||
---|---|---|
75 | 75 |
VersionNotExists) |
76 | 76 |
|
77 | 77 |
from synnefo.lib import join_urls |
78 |
from synnefo.util import text |
|
78 | 79 |
|
79 | 80 |
from astakosclient import AstakosClient |
80 | 81 |
from astakosclient.errors import NoUserName, NoUUID, AstakosClientException |
... | ... | |
1173 | 1174 |
|
1174 | 1175 |
try: |
1175 | 1176 |
access_token = request.GET.get('access_token') |
1176 |
requested_resource = request.path.split(VIEW_PREFIX, 2)[-1] |
|
1177 |
requested_resource = text.uenc(request.path.split(VIEW_PREFIX, |
|
1178 |
2)[-1]) |
|
1177 | 1179 |
astakos = AstakosClient(SERVICE_TOKEN, ASTAKOS_AUTH_URL, |
1178 | 1180 |
retry=2, use_pool=True, |
1179 | 1181 |
logger=logger) |
... | ... | |
1205 | 1207 |
'redirect_uri': |
1206 | 1208 |
request.build_absolute_uri(request.path), |
1207 | 1209 |
'state': '', # TODO include state for security |
1208 |
'scope': request.path.split(VIEW_PREFIX, 2)[-1]}
|
|
1210 |
'scope': requested_resource}
|
|
1209 | 1211 |
return HttpResponseRedirect('%s?%s' % |
1210 | 1212 |
(join_urls(astakos.oauth2_url, |
1211 | 1213 |
'auth'), |
Also available in: Unified diff