Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Single session per user while integrating with Omniauth Azure AD #885

Open
sithara opened this issue Mar 5, 2020 · 2 comments
Open

Single session per user while integrating with Omniauth Azure AD #885

sithara opened this issue Mar 5, 2020 · 2 comments

Comments

@sithara
Copy link

sithara commented Mar 5, 2020

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

@mjankowski
Copy link
Contributor

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?

@sithara
Copy link
Author

sithara commented Mar 6, 2020

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants