Revision e7f0ec5e

b/snf-pithos-app/pithos/api/util.py
1211 1211
                                                           'auth'),
1212 1212
                                                 urlencode(params)))
1213 1213
                else:
1214
                    # request short-term access code
1215

  
1216
                    # resolve redirect host. If SERVE_API_DOMAIN is set
1217
                    # redirect to that host instead.
1218
                    redirect_host = BASE_HOST
1219
                    if SERVE_API_DOMAIN:
1220
                        redirect_host = SERVE_API_DOMAIN
1221
                        proto = 'https' if request.is_secure() else 'http'
1222
                        redirect_host = '%s://%s' % (proto, redirect_host)
1223

  
1224
                    redirect_uri = '%s%s' % (redirect_host, request.path)
1214
                    # request short-term access token
1215
                    redirect_uri = request.build_absolute_uri(request.path)
1225 1216
                    data = astakos.get_token('authorization_code',
1226 1217
                                             *OAUTH2_CLIENT_CREDENTIALS,
1227 1218
                                             redirect_uri=redirect_uri,

Also available in: Unified diff