public class CasSecurityRealm
extends hudson.security.SecurityRealm
| Modifier and Type | Class and Description |
|---|---|
static class |
CasSecurityRealm.DescriptorImpl |
| Modifier and Type | Field and Description |
|---|---|
CasProtocol |
casProtocol |
String |
casServerUrl |
static String |
DEFAULT_COMMENCE_LOGIN_URL |
static String |
DEFAULT_FAILED_LOGIN_URL |
static String |
DEFAULT_FINISH_LOGIN_URL |
Boolean |
enableRestApi |
Boolean |
enableSingleSignOut |
Boolean |
forceRenewal |
| Constructor and Description |
|---|
CasSecurityRealm(String casServerUrl,
CasProtocol casProtocol,
Boolean forceRenewal,
Boolean enableSingleSignOut)
Deprecated.
|
CasSecurityRealm(String casServerUrl,
CasProtocol casProtocol,
Boolean forceRenewal,
Boolean enableSingleSignOut,
Boolean enableRestApi) |
| Modifier and Type | Method and Description |
|---|---|
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 authentication manager which uses the CAS REST API for username and password based authentication against
the REST API.
|
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.
|
protected CasRestAuthenticator |
getCasRestAuthenticator()
Get or create the CAS REST client for API authentication.
|
static String |
getFailedLoginUrl()
Get the URL to redirect to in case of authentication failure.
|
static String |
getFinishLoginUrl()
Get the callback URL after CAS authentication.
|
static String |
getJenkinsUrl()
Get the root Jenkins URL configured in global settings.
|
static String |
getJenkinsUrl(javax.servlet.http.HttpServletRequest req)
Get the root Jenkins URL configured in global settings, or construct it
from the current HTTP request.
|
String |
getLoginUrl()
Login begins with our
doCommenceLogin(StaplerRequest, StaplerResponse) method. |
protected String |
getPostLogOutUrl(org.kohsuke.stapler.StaplerRequest req,
org.acegisecurity.Authentication auth)
Logout redirects to CAS before coming back to Jenkins.
|
static String |
getServiceUrl(javax.servlet.http.HttpServletRequest req,
org.springframework.security.cas.ServiceProperties serviceProperties)
Get the full service URL for use with CAS.
|
protected boolean |
isRestApiEnabled()
Check if the CAS REST API is enabled.
|
all, allowsSignup, canLogOut, commenceSignup, createCliAuthenticator, doCaptcha, findBean, getAuthenticationGatewayUrl, getCaptchaSupport, getCaptchaSupportDescriptors, getDescriptor, getGroupIdStrategy, getSecurityComponents, getUserIdStrategy, loadGroupByGroupname, loadGroupByGroupname, loadUserByUsername, setCaptchaSupport, validateCaptchapublic static final String DEFAULT_COMMENCE_LOGIN_URL
public static final String DEFAULT_FINISH_LOGIN_URL
public static final String DEFAULT_FAILED_LOGIN_URL
public final String casServerUrl
public final CasProtocol casProtocol
public final Boolean forceRenewal
public final Boolean enableSingleSignOut
public final Boolean enableRestApi
@Deprecated public CasSecurityRealm(String casServerUrl, CasProtocol casProtocol, Boolean forceRenewal, Boolean enableSingleSignOut)
@DataBoundConstructor public CasSecurityRealm(String casServerUrl, CasProtocol casProtocol, Boolean forceRenewal, Boolean enableSingleSignOut, Boolean enableRestApi)
public static String getJenkinsUrl()
public static String getJenkinsUrl(javax.servlet.http.HttpServletRequest req)
req - current HTTP requestpublic static String getFinishLoginUrl()
public static String getFailedLoginUrl()
public static String getServiceUrl(javax.servlet.http.HttpServletRequest req, org.springframework.security.cas.ServiceProperties serviceProperties)
req - current HTTP requestserviceProperties - service propertiesprotected org.springframework.web.context.WebApplicationContext getApplicationContext()
protected CasRestAuthenticator getCasRestAuthenticator()
protected boolean isRestApiEnabled()
public String getLoginUrl()
doCommenceLogin(StaplerRequest, StaplerResponse) method.getLoginUrl in class hudson.security.SecurityRealmprotected String getPostLogOutUrl(org.kohsuke.stapler.StaplerRequest req, org.acegisecurity.Authentication auth)
getPostLogOutUrl in class hudson.security.SecurityRealmpublic hudson.security.SecurityRealm.SecurityComponents createSecurityComponents()
createSecurityComponents in class hudson.security.SecurityRealmpublic javax.servlet.Filter createFilter(javax.servlet.FilterConfig filterConfig)
createFilter in class hudson.security.SecurityRealmpublic void doLogout(org.kohsuke.stapler.StaplerRequest req,
org.kohsuke.stapler.StaplerResponse rsp)
throws IOException,
javax.servlet.ServletException
doLogout in class hudson.security.SecurityRealmreq - requestrsp - responseIOExceptionjavax.servlet.ServletExceptionpublic void doCommenceLogin(org.kohsuke.stapler.StaplerRequest req,
org.kohsuke.stapler.StaplerResponse rsp)
throws IOException,
javax.servlet.ServletException
req - requestrsp - responseIOExceptionjavax.servlet.ServletExceptionpublic void doFinishLogin(org.kohsuke.stapler.StaplerRequest req,
org.kohsuke.stapler.StaplerResponse rsp)
req - requestrsp - responseCopyright © 2016–2017. All rights reserved.