clearance icon indicating copy to clipboard operation
clearance copied to clipboard

Single session per user while integrating with Omniauth Azure AD

Open sithara opened this issue 4 years ago • 2 comments

Is there a workaround to prevent concurrent user signs while using Azure AD for authentication

The below code snippet is likely to work only if the default sign in mechanism is used

  def sign_in(user)
    user.reset_remember_token! if user
    super
  end 

Thanks

sithara avatar Mar 05 '20 09:03 sithara

Can you add a little detail about what you want to happen?

My guess is that you're using clearance for session maintenance ... but want to actually auth with another service/lib and then have a callback/hook into clearance to reset that user's session when they sign in?

mjankowski avatar Mar 05 '20 11:03 mjankowski

Thanks for the prompt response @mjankowski .

I had integrated gem 'omniauth-azure-activedirectory' with my application. Using the creds from azure active directory I activate the clearance user sessions, and this works perfectly.

I was trying to implement block concurrent user sign in. How do I force the user to logout of his first instance if he has initiated a second one?

sithara avatar Mar 06 '20 02:03 sithara