Sha256: f993a6b98ebd5403ea1a21ba2cc5f3ba8a9f7f0075102baa906b26ab093d62ed

Contents?: true

Size: 1.18 KB

Versions: 3

Compression:

Stored size: 1.18 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
    # Check all Groups for Prefixes
    groups = params["shibboleth_debug_login"][:groups].split(";").map do |group|
      check_group_prefix(group)
    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
  private
    def check_group_prefix group
      group = ShibbolethAuth::GroupPrefixField + ":" + group unless group.include?(ShibbolethAuth::GroupPrefixField)
      return group
    end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
shibboleth_auth-0.3.2 app/controllers/login_controller.rb
shibboleth_auth-0.3.1 app/controllers/login_controller.rb
shibboleth_auth-0.3.0 app/controllers/login_controller.rb