Class: FederatedRails::AuthController

Inherits:
ApplicationController
  • Object
show all
Defined in:
app/controller/federated_rails/auth_controller.rb

Instance Method Summary collapse

Instance Method Details

#development_loginObject



41
42
43
44
45
46
47
48
49
50
51
52
53
# File 'app/controller/federated_rails/auth_controller.rb', line 41

def 
  if Rails.application.config.federation.developmentactive
    warden.authenticate!(:development_login)
    
    uri = session[:security_manager_return_to] ||= url_for(root_path)
    logger.info "Redirecting principal #{security_manager.subject.principal} to #{uri.inspect}"
    redirect_to uri
  else
    logger.error "Attempt utilize development login when development is disabled"
    render :partial => "loginerror", :nothing => true, :status => 403
    return
  end
end

#federation_loginObject



27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'app/controller/federated_rails/auth_controller.rb', line 27

def 
  if Rails.application.config.federation.federationactive
    warden.authenticate!(:federation_login)
    
    uri = session[:security_manager_return_to] ||= url_for(root_path)
    logger.info "Redirecting principal #{security_manager.subject.principal} to #{uri.inspect}"
    redirect_to uri
  else
    logger.error "Attempt utilize federation login when federation disabled"
    render :partial => "loginerror", :nothing => true, :status => :forbidden
    return
  end
end

#loginObject



6
7
8
9
10
11
12
13
14
15
# File 'app/controller/federated_rails/auth_controller.rb', line 6

def 
  # Integrates with Shibboleth NativeSPSessionCreationParameters as per https://wiki.shibboleth.net/confluence/display/SHIB2/NativeSPSessionCreationParameters
   = "#{Rails.application.config.federation.ssoendpoint}?target=#{url_for(:controller => 'auth', :action => 'federation_login')}"
  if Rails.application.config.federation.automatelogin
    redirect_to 
    return
  end

  @spsession_url = 
end

#logoutObject



17
18
19
20
21
22
# File 'app/controller/federated_rails/auth_controller.rb', line 17

def logout
  uri = url_for root_path
  logger.info "Logging out principal #{security_manager.subject.principal} and directing to #{uri.inspect}" if security_manager.subject
  warden.logout
  redirect_to uri
end

#unauthenticatedObject



24
25
# File 'app/controller/federated_rails/auth_controller.rb', line 24

def unauthenticated
end