Giter VIP home page Giter VIP logo

discourse_cas_sso's Introduction

Discourse CAS sso app

This app acts as a CAS SSO for instances of discussion tool Discourse. It can connect any number of discourse instances* to a single cas URL/host.

In addition to doing authentication part it also can use the extra groups attibute of the cas data to control login/account create to members of certain groups. Deny overrides Allow in the configureation.

*All discourse instances need to use the same sso secret which is not a great thing. If you control all instances is the risk is a little bit less but not great.

Configuration

CAS server setup

Required Values

You CAS server will need to return at minimum a username and a email address.

Optional Values

If you want to use the groups and/or the photo functionality the server will also need to return those values

cas_sso application setup.

There are two places that you need to enter configuration information. The first is in config/configation/defaults.rb . There you will need to set the

  • configatron.sso.secret to the value that was set in the discourse(s) instance you are useing

These are the name of the attribute in the cas data. This is particular to you configuration and you will need to talk to your CAS adminstrator to find out what they are and possibly to active sending them.

  • configatron.cas.email_attribute - CAS attribute containing user’s e-mail. Example: ‘mail’ or ‘UserPrincipalName’

  • configatron.cas.name_attribute - CAS attribute containing user’s username. Example: ‘nickname’ or ‘Name’

  • configatron.cas.avatar_enabled - Specifies whether avatars should be consumed and provided to Discourse.

  • configatron.cas.avatar_url_attribute - CAS attribute containing user’s photo. Example: ‘jpegPhoto’

  • configatron.cas.avatar_force_update_attribute - Discourse parameter specifying whether avatar should be re-downloaded if cached. Discourse does not re-download avatars that have already been downloaded from the same URL. See: github.com/discourse/discourse/pull/2670

You will also need to set the cas server host in config/initializers/omniauth.rb

Run the migration. It will add a db (sqlite) to be used for the eventual SLO support.

Edit the application.html.erb layout file to meet your organizations needs. Bootstrap is available.

Optional settings config/configation/defaults.rb You can activate the groups filtering and turn on or off the checking of the allow and deny groups independently. In the case you are using Active Directory as the backend to a Jasig CAS server the groups information will be in the form of LDAP groups. You mileage may vary with other combinations. You may also have to get your CAS administrator to activate sending groups information. The name of the attribute used to access the groups is based on the above configuration also.

You will also want to change the login failure.html.erb page and the application.html.erb layout to suit your organization.

Thanks

Avatar/photo functionality was written by @jankaltoun .

Unfinished

At this point there is no action an the CAS server sending out SLO requests when user logs out of cas or their session ends. To do this will require that discourse adds a /sso/logout that accepts the payload that was sent in the original sso request. This will log out just the single session attached to that cas TGT and ST. At this point I do not think this is possible to do

discourse_cas_sso's People

Contributors

eriko avatar ikbear avatar jankaltoun avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.