Sha256: 8c002cc6130d2b132c298996e0e3283e8961f0279fada8f75050a1b7300421fe

Contents?: true

Size: 1.06 KB

Versions: 4

Compression:

Stored size: 1.06 KB

Contents

class ShibbolethAuth::LoginController < ApplicationController

  # GET /shibboleth_auth/login
  def login_form
  end
  
  # GET /shibboleth_auth/show
  def show
  end

  # POST /shibboleth_auth/login
  def login
    # Adding Group Prefix
    groups = params["shibboleth_debug_login"][:groups].split(";").map do |group|
      ShibbolethAuth::GroupPrefixField + ":" + group unless group.include?(ShibbolethAuth::GroupPrefixField)
    end.join(";")
    
    session[:shibboleth_debug_env] = {
      ShibbolethAuth::UsernameField => params["shibboleth_debug_login"][:person_uid],
      ShibbolethAuth::CommonNameField => params["shibboleth_debug_login"][:person_common_name],
      ShibbolethAuth::GroupsField => groups,
      ShibbolethAuth::AffiliationField => params["shibboleth_debug_login"][:unscoped_affiliation],
      'debug_login' => true
    }
    session[:shibboleth_debug_login] = true
    redirect_to :root
  end

  # GET /shibboleth_auth/logout
  def logout
    session[:shibboleth_debug_login] = false
    session[:shibboleth_debug_env] = nil
    redirect_to :root
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
shibboleth_auth-0.2.1 app/controllers/login_controller.rb
shibboleth_auth-0.1.2 app/controllers/login_controller.rb
shibboleth_auth-0.1.1 app/controllers/login_controller.rb
shibboleth_auth-0.1.0 app/controllers/login_controller.rb