Skip to content

Commit

Permalink
Replaced a temporary redirect URI assignment with a config kvp.
Browse files Browse the repository at this point in the history
  • Loading branch information
VJalili committed Dec 17, 2017
1 parent e168eaf commit 009248b
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions lib/galaxy/authnz/psa_authnz.py
Expand Up @@ -133,17 +133,11 @@ def callback(self, state_token, authz_code, trans):

def disconnect(self, provider, trans, redirect_url=None, association_id=None):
self._on_the_fly_config(trans)
uri = '/authn/{provider}/callback' # TODO find a better of doing this -- this info should be passed from buildapp.py

config[setting_name('DISCONNECT_REDIRECT_URL')] = redirect_url if redirect_url is not None else ()
self.strategy = Strategy(trans, Storage) # self.load_strategy()
# the following line is temporary, find a better solution.
self.backend = self.load_backend(self.strategy, uri)
# TODO: Google requires all the redirect URIs to start with http[s]; however, eventhough the redirect uri
# in the config starts with http, PSA removes the http prefix, and this causes authentication failing on
# google. The following is a temporary patch. This problem should be solved properly.
# might be able to the following using absolute_uri function in the strategy
self.backend.redirect_uri = "http://" + self.backend.redirect_uri
self.backend = self.load_backend(self.strategy, config['redirect_uri'])
self.backend.redirect_uri = config['redirect_uri']
# this is also temp; it is required in login_user. Find a method around using login_user -- I should not need it -- then remove the following line.
self.trans = trans
return do_disconnect(self.backend, self.get_current_user(trans), association_id)
Expand Down

0 comments on commit 009248b

Please sign in to comment.