Skip to content

Commit

Permalink
updated handling of default RelayState attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
ganiserb committed Mar 18, 2016
1 parent a6dc168 commit e732091
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions djangosaml2/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,11 +243,12 @@ def assertion_consumer_service(request,
post_authenticated.send_robust(sender=user, session_info=session_info)

# redirect the user to the view where he came from
default_relay_state = get_custom_setting('ACS_DEFAULT_REDIRECT_URL', '/')
default_relay_state = get_custom_setting('ACS_DEFAULT_REDIRECT_URL',
settings.LOGIN_REDIRECT_URL)
relay_state = request.POST.get('RelayState', default_relay_state)
if not relay_state:
logger.warning('The RelayState parameter exists but is empty')
relay_state = settings.LOGIN_REDIRECT_URL
relay_state = default_relay_state
logger.debug('Redirecting to the RelayState: %s', relay_state)
return HttpResponseRedirect(relay_state)

Expand Down

0 comments on commit e732091

Please sign in to comment.