apokalipto / devise_saml_authenticatable

Devise SAML 2.0 authentication strategy
MIT License
293 stars 150 forks source link

ActiveAdmin integration #124

Open rarhoade opened 6 years ago

rarhoade commented 6 years ago

I have been trying to implement ActiveAdmin integration using this gem for the past week and I'm convinced that it won't play nice with saml. Has anyone used this gem to setup saml for ActiveAdmin? I went through this tutorial http://www.michaelsommer.nl/2016/06/implementing-single-sign-on-with-adfs.html but to no luck

adamstegman commented 6 years ago

I'm not sure you need to go to all the trouble in that post—it sets up a special type of user/authentication for ActiveAdmin instead of using role-based access, which might not apply to you.

If you just need to authenticate to access ActiveAdmin, it should be able to call the normal authenticate_user! method that Devise adds (or authenticate_admin_user! if you're following that post). In our usage, it looks like this in config/initializers/active_admin.rb:

config.authentication_method = :authenticate_user!

There's a separate authorization_adapter you can use to check permissions for users.

rarhoade commented 6 years ago

Did you set it up so that you just have your routes set up as devise_for: admin_user and that's it? Because when I went through it that way all of my routes were messed up. And how did you get to that conclusion for switching the authentication_method in the initializers? The documentation never touched on messing with those when it came to that.

adamstegman commented 6 years ago

We don't have a separate admin user, so these routes are not really an issue for us. We use the same user authentication for normal access as for ActiveAdmin access. What are your user models? And your routes?

Here's the ActiveAdmin docs on authentication, the first one mentioned is the authentication_method: https://activeadmin.info/1-general-configuration.html#authentication

fedeagripa commented 4 years ago

@adamstegman @rarhoade I just implemented this for ActiveAdmin, feel free to close this issue, will add a post I just made explaining how to asap (still reviewing some details about it :) )