org.jenkinsci.plugins.cas
Class CasSecurityRealm

java.lang.Object
  extended by hudson.model.AbstractDescribableImpl<hudson.security.SecurityRealm>
      extended by hudson.security.SecurityRealm
          extended by org.jenkinsci.plugins.cas.CasSecurityRealm
All Implemented Interfaces:
hudson.ExtensionPoint, hudson.model.Describable<hudson.security.SecurityRealm>

public class CasSecurityRealm
extends hudson.security.SecurityRealm

Jasig CAS Single Sign-On security realm.

Author:
Fabien Crespel , J. David Beutel
See Also:
http://www.jasig.org/cas

Nested Class Summary
static class CasSecurityRealm.DescriptorImpl
           
 
Nested classes/interfaces inherited from class hudson.security.SecurityRealm
hudson.security.SecurityRealm.SecurityComponents
 
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
hudson.ExtensionPoint.LegacyInstancesAreScopedToHudson
 
Field Summary
 CasProtocol casProtocol
           
 String casServerUrl
           
static String DEFAULT_FINISH_LOGIN_URL
           
 Boolean enableSingleSignOut
           
 Boolean forceRenewal
           
 
Fields inherited from class hudson.security.SecurityRealm
AUTHENTICATED_AUTHORITY, LIST, NO_AUTHENTICATION
 
Constructor Summary
CasSecurityRealm(String casServerUrl, CasProtocol casProtocol, Boolean forceRenewal, Boolean enableSingleSignOut)
           
 
Method Summary
 javax.servlet.Filter createFilter(javax.servlet.FilterConfig filterConfig)
          Build the filter that will validate the service ticket returned by CAS.
 hudson.security.SecurityRealm.SecurityComponents createSecurityComponents()
          Build a no-op authentication manager as everything is handled by a separate CAS filter chain.
 void doCommenceLogin(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp)
          The login process starts from here, using the CasAuthenticationEntryPoint defined in the CasSecurityRealm.groovy application context.
 void doFinishLogin(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp)
          The login process finishes here, although by the time this action is called everything has already been taken care of by filters.
 void doLogout(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp)
          Handles the logout processing.
protected  org.springframework.web.context.WebApplicationContext getApplicationContext()
          Create the Spring application context that will hold CAS filters.
 String getFinishLoginUrl()
           
 String getJenkinsUrl()
           
 String getLoginUrl()
          Login begins with our #doCommenceLogin(String) method.
protected  String getPostLogOutUrl(org.kohsuke.stapler.StaplerRequest req, org.acegisecurity.Authentication auth)
          Logout redirects to CAS before coming back to Jenkins.
 
Methods inherited from class hudson.security.SecurityRealm
all, allowsSignup, canLogOut, commenceSignup, createCliAuthenticator, doCaptcha, findBean, getAuthenticationGatewayUrl, getCaptchaSupport, getCaptchaSupportDescriptors, getDescriptor, getSecurityComponents, loadGroupByGroupname, loadUserByUsername, setCaptchaSupport, validateCaptcha
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_FINISH_LOGIN_URL

public static final String DEFAULT_FINISH_LOGIN_URL
See Also:
Constant Field Values

casServerUrl

public final String casServerUrl

casProtocol

public final CasProtocol casProtocol

forceRenewal

public final Boolean forceRenewal

enableSingleSignOut

public final Boolean enableSingleSignOut
Constructor Detail

CasSecurityRealm

@DataBoundConstructor
public CasSecurityRealm(String casServerUrl,
                                             CasProtocol casProtocol,
                                             Boolean forceRenewal,
                                             Boolean enableSingleSignOut)
Method Detail

getJenkinsUrl

public String getJenkinsUrl()

getFinishLoginUrl

public String getFinishLoginUrl()

getApplicationContext

protected org.springframework.web.context.WebApplicationContext getApplicationContext()
Create the Spring application context that will hold CAS filters.


getLoginUrl

public String getLoginUrl()
Login begins with our #doCommenceLogin(String) method.

Overrides:
getLoginUrl in class hudson.security.SecurityRealm

getPostLogOutUrl

protected String getPostLogOutUrl(org.kohsuke.stapler.StaplerRequest req,
                                  org.acegisecurity.Authentication auth)
Logout redirects to CAS before coming back to Jenkins.

Overrides:
getPostLogOutUrl in class hudson.security.SecurityRealm

createSecurityComponents

public hudson.security.SecurityRealm.SecurityComponents createSecurityComponents()
Build a no-op authentication manager as everything is handled by a separate CAS filter chain.

Specified by:
createSecurityComponents in class hudson.security.SecurityRealm

createFilter

public javax.servlet.Filter createFilter(javax.servlet.FilterConfig filterConfig)
Build the filter that will validate the service ticket returned by CAS. This filter, defined in the CasSecurityRealm.groovy application context, will wrap the original filter chain from Jenkins to preserve support for API token authentication (among other features).

Overrides:
createFilter in class hudson.security.SecurityRealm

doLogout

public void doLogout(org.kohsuke.stapler.StaplerRequest req,
                     org.kohsuke.stapler.StaplerResponse rsp)
              throws IOException,
                     javax.servlet.ServletException
Handles the logout processing.

Overrides:
doLogout in class hudson.security.SecurityRealm
Throws:
IOException
javax.servlet.ServletException

doCommenceLogin

public void doCommenceLogin(org.kohsuke.stapler.StaplerRequest req,
                            org.kohsuke.stapler.StaplerResponse rsp)
                     throws IOException,
                            javax.servlet.ServletException
The login process starts from here, using the CasAuthenticationEntryPoint defined in the CasSecurityRealm.groovy application context.

Throws:
IOException
javax.servlet.ServletException

doFinishLogin

public void doFinishLogin(org.kohsuke.stapler.StaplerRequest req,
                          org.kohsuke.stapler.StaplerResponse rsp)
The login process finishes here, although by the time this action is called everything has already been taken care of by filters.



Copyright © 2004-2012. All Rights Reserved.