Skip to content

Instantly share code, notes, and snippets.

@dchandekstark
Last active August 29, 2015 14:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dchandekstark/2f5825fb5a44f2cc56e9 to your computer and use it in GitHub Desktop.
Save dchandekstark/2f5825fb5a44f2cc56e9 to your computer and use it in GitHub Desktop.
SessionsController - Devise + Ominauth + Shibboleth
class Users::SessionsController < Devise::SessionsController
def new
store_location_for(:user, request.referrer) # return to previous page after authn
if Ddr::Auth.require_shib_user_authn
# don't want the "sign in or sign up" flash in this case
flash.discard(:alert)
redirect_to user_omniauth_authorize_path(:shibboleth)
else
super
end
end
def after_sign_out_path_for(scope)
return Ddr::Auth.sso_logout_url if Ddr::Auth.require_shib_user_authn
super
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment