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

CAS Authentication #131

Merged

Conversation

mur-wtag
Copy link
Contributor

@mur-wtag mur-wtag commented Oct 31, 2016

Optional CAS authentication added to bookyt

  • gem devise_cas_authenticatable added
  • Configuration added for CAS authentication
  • Configuration added for extra-attributes

Documentation

Authentcation

You can decide between two authentication mechanisms: Database Authentication, database_authenticatable (default) and CAS Authentication cas_authenticatable.

Database Authentication

For Database Authentication, no changes are needed.

CAS Authentication

If you go for CAS Authentication, set devise_backend to cas_authenticatable and make sure to set cas_base_url.

To handle the extra attributes, add a class named CASExtraAttributesMapper which responds to .call. For example:

class CASExtraAttributesMapper
  def self.call(extra_attributes, user)
    extra_attributes.each do |name, value|
      case name.to_sym
      when :full_name
        user.fullname = value
      when :roles
        user.role_texts = [value.split(',')].flatten
      end
      # And so on for other attributes
    end
  end
end

mur-wtag added 8 commits October 30, 2016 11:53
- Cas authentication integrated for User
- For AdminUser it remains as it is
--- AF-24
--- AF-24
--- AF-24
--- AF-24
--- AF-24
@luxflux
Copy link
Collaborator

luxflux commented Oct 31, 2016

@huerlisi these are the changes we did to the codebase to add support for CAS authentication. Are you interested into such features?

@huerlisi
Copy link
Owner

Nice!

I don't think I'll ever need it or can even test it, but I'm more than happy to take this valuable contribution!

I'll look into it in the next couple days.

@luxflux luxflux changed the title AF-24 Prepare sso for welltravel accounts CAS Authentication Jan 9, 2017
@luxflux
Copy link
Collaborator

luxflux commented Jan 9, 2017

@huerlisi were you able to have a look into it? Otherwise I'm going to merge it during the next days.

@luxflux luxflux requested a review from huerlisi January 9, 2017 10:35
@huerlisi
Copy link
Owner

I've fixed a conflict in the merge request. It look all good from my side.

Thanks a lot for this.

@huerlisi huerlisi merged commit 5bb2737 into huerlisi:master Jan 10, 2017
@luxflux luxflux deleted the AF-24-prepare-sso-for-welltravel-accounts branch January 10, 2017 22:29
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

Successfully merging this pull request may close these issues.

3 participants