/*
* Licensed to Jasig under one or more contributor license
* agreements. See the NOTICE file distributed with this work
* for additional information regarding copyright ownership.
* Jasig licenses this file to you under the Apache License,
* Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a
* copy of the License at the following location:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.jasig.cas;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import javax.validation.constraints.NotNull;
import com.github.inspektr.audit.annotation.Audit;
import org.apache.commons.lang.StringUtils;
import org.jasig.cas.authentication.AcceptAnyAuthenticationPolicyFactory;
import org.jasig.cas.authentication.Authentication;
import org.jasig.cas.authentication.AuthenticationBuilder;
import org.jasig.cas.authentication.AuthenticationException;
import org.jasig.cas.authentication.AuthenticationManager;
import org.jasig.cas.authentication.ContextualAuthenticationPolicy;
import org.jasig.cas.authentication.ContextualAuthenticationPolicyFactory;
import org.jasig.cas.authentication.MixedPrincipalException;
import org.jasig.cas.authentication.Credential;
import org.jasig.cas.authentication.principal.PersistentIdGenerator;
import org.jasig.cas.authentication.principal.Principal;
import org.jasig.cas.authentication.principal.Service;
import org.jasig.cas.authentication.principal.ShibbolethCompatiblePersistentIdGenerator;
import org.jasig.cas.authentication.principal.SimplePrincipal;
import org.jasig.cas.logout.LogoutManager;
import org.jasig.cas.logout.LogoutRequest;
import org.jasig.cas.services.RegisteredService;
import org.jasig.cas.services.RegisteredServiceAttributeFilter;
import org.jasig.cas.services.ServiceContext;
import org.jasig.cas.services.ServicesManager;
import org.jasig.cas.services.UnauthorizedProxyingException;
import org.jasig.cas.services.UnauthorizedServiceException;
import org.jasig.cas.services.UnauthorizedSsoServiceException;
import org.jasig.cas.services.support.RegisteredServiceDefaultAttributeFilter;
import org.jasig.cas.ticket.ExpirationPolicy;
import org.jasig.cas.ticket.InvalidTicketException;
import org.jasig.cas.ticket.ServiceTicket;
import org.jasig.cas.ticket.TicketException;
import org.jasig.cas.ticket.TicketGrantingTicket;
import org.jasig.cas.ticket.TicketGrantingTicketImpl;
import org.jasig.cas.ticket.TicketValidationException;
import org.jasig.cas.ticket.UnsatisfiedAuthenticationPolicyException;
import org.jasig.cas.ticket.registry.TicketRegistry;
import org.jasig.cas.util.UniqueTicketIdGenerator;
import org.jasig.cas.validation.Assertion;
import org.jasig.cas.validation.ImmutableAssertion;
import org.perf4j.aop.Profiled;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.Assert;
/**
* Concrete implementation of a CentralAuthenticationService, and also the
* central, organizing component of CAS's internal implementation.
* <p>
* This class is threadsafe.
* <p>
* This class has the following properties that must be set:
* <ul>
* <li> <code>ticketRegistry</code> - The Ticket Registry to maintain the list
* of available tickets.</li>
* <li> <code>serviceTicketRegistry</code> - Provides an alternative to configure separate registries for
* TGTs and ST in order to store them in different locations (i.e. long term memory or short-term)</li>
* <li> <code>authenticationManager</code> - The service that will handle
* authentication.</li>
* <li> <code>ticketGrantingTicketUniqueTicketIdGenerator</code> - Plug in to
* generate unique secure ids for TicketGrantingTickets.</li>
* <li> <code>serviceTicketUniqueTicketIdGenerator</code> - Plug in to
* generate unique secure ids for ServiceTickets.</li>
* <li> <code>ticketGrantingTicketExpirationPolicy</code> - The expiration
* policy for TicketGrantingTickets.</li>
* <li> <code>serviceTicketExpirationPolicy</code> - The expiration policy for
* ServiceTickets.</li>
* </ul>
*
* @author William G. Thompson, Jr.
* @author Scott Battaglia
* @author Dmitry Kopylenko
* @since 3.0
*/
public final class CentralAuthenticationServiceImpl implements CentralAuthenticationService {
/** Log instance for logging events, info, warnings, errors, etc. */
private final Logger logger = LoggerFactory.getLogger(this.getClass());
/** TicketRegistry for storing and retrieving tickets as needed. */
@NotNull
private final TicketRegistry ticketRegistry;
/** New Ticket Registry for storing and retrieving services tickets. Can point to the same one as the ticketRegistry variable. */
@NotNull
private final TicketRegistry serviceTicketRegistry;
/**
* AuthenticationManager for authenticating credentials for purposes of
* obtaining tickets.
*/
@NotNull
private final AuthenticationManager authenticationManager;
/**
* UniqueTicketIdGenerator to generate ids for TicketGrantingTickets
* created.
*/
@NotNull
private final UniqueTicketIdGenerator ticketGrantingTicketUniqueTicketIdGenerator;
/** Map to contain the mappings of service->UniqueTicketIdGenerators. */
@NotNull
private final Map<String, UniqueTicketIdGenerator> uniqueTicketIdGeneratorsForService;
/** Implementation of Service Manager. */
@NotNull
private final ServicesManager servicesManager;
/** The logout manager. **/
@NotNull
private final LogoutManager logoutManager;
/** Expiration policy for ticket granting tickets. */
@NotNull
private ExpirationPolicy ticketGrantingTicketExpirationPolicy;
/** ExpirationPolicy for Service Tickets. */
@NotNull
private ExpirationPolicy serviceTicketExpirationPolicy;
/** Encoder to generate PseudoIds. */
@NotNull
private PersistentIdGenerator persistentIdGenerator = new ShibbolethCompatiblePersistentIdGenerator();
/** The default attribute filter to match principal attributes against that of a registered service. **/
private RegisteredServiceAttributeFilter defaultAttributeFilter = new RegisteredServiceDefaultAttributeFilter();
/**
* Authentication policy that uses a service context to produce stateful security policies to apply when
* authenticating credentials.
*/
@NotNull
private ContextualAuthenticationPolicyFactory<ServiceContext> serviceContextAuthenticationPolicyFactory =
new AcceptAnyAuthenticationPolicyFactory();
/**
* Build the central authentication service implementation.
*
* @param ticketRegistry the tickets registry.
* @param serviceTicketRegistry the service tickets registry.
* @param authenticationManager the authentication manager.
* @param ticketGrantingTicketUniqueTicketIdGenerator the TGT id generator.
* @param uniqueTicketIdGeneratorsForService the map with service and ticket id generators.
* @param ticketGrantingTicketExpirationPolicy the TGT expiration policy.
* @param serviceTicketExpirationPolicy the service ticket expiration policy.
* @param servicesManager the services manager.
* @param logoutManager the logout manager.
*/
public CentralAuthenticationServiceImpl(final TicketRegistry ticketRegistry,
final TicketRegistry serviceTicketRegistry,
final AuthenticationManager authenticationManager,
final UniqueTicketIdGenerator ticketGrantingTicketUni
没有合适的资源?快使用搜索试试~ 我知道了~
cas-server-4.0.0服务端
共892个文件
java:546个
xml:135个
properties:66个
需积分: 9 49 下载量 15 浏览量
2018-03-06
10:35:01
上传
评论 2
收藏 79.88MB ZIP 举报
温馨提示
下面连接:基础环境搭建 http://blog.csdn.net/zangguangtian/article/details/79454500 下面连接:配置数据库支持 http://blog.csdn.net/zangguangtian/article/details/79454349
资源推荐
资源详情
资源评论
收起资源包目录
cas-server-4.0.0服务端 (892个子文件)
jaas.conf 958B
userCA-valid.crl 902B
userCA-expired.crl 857B
intermediateCA-valid.crl 682B
intermediateCA-expired.crl 682B
rootCA-valid.crl 674B
user-valid-chain.crt 6KB
user-valid-distcrl.crt 5KB
user-revoked-distcrl2.crt 5KB
userCA.crt 5KB
intermediateCA.crt 5KB
user-revoked-distcrl.crt 5KB
user-valid-keyUsage.crt 5KB
user-invalid-keyUsage.crt 4KB
user-expired.crt 4KB
user-revoked.crt 4KB
user-valid.crt 4KB
snake-oil.crt 2KB
rootCA.crt 1KB
x509-ctop-resolver-hizzy.crt 1KB
x509-ctop-resolver-gazzo.crt 1KB
x509-ctop-resolver-jacky.crt 1KB
management.css 11KB
cas.css 7KB
ja-sig-logo.gif 1KB
ja-sig-logo.gif 1KB
error.gif 1KB
info_icon_small.gif 1KB
info.gif 980B
confirm.gif 958B
delete_service.gif 928B
edit_service.gif 816B
add_service.gif 720B
info.gif 437B
error.gif 382B
success.gif 230B
key-point_br.gif 186B
key-point_tr.gif 105B
key-point_tl.gif 103B
alert2.gif 102B
key-point_bl.gif 102B
false.gif 88B
true.gif 83B
red.gif 43B
green.gif 43B
package.html 3KB
package.html 3KB
package.html 2KB
package.html 2KB
package.html 2KB
package.html 1KB
package.html 1KB
package.html 1KB
package.html 1KB
package.html 1KB
package.html 1KB
package.html 1KB
package.html 1KB
package.html 1KB
package.html 997B
package.html 981B
package.html 958B
package.html 933B
package.html 910B
package.html 910B
package.html 902B
package.html 891B
favicon.ico 170B
favicon.ico 170B
cas-server-core-4.0.0.jar 226KB
cas-server-webapp-support-4.0.0.jar 55KB
cas-server-support-ldap-4.0.0.jar 40KB
cas-server-support-x509-4.0.0.jar 36KB
cas-server-support-saml-4.0.0.jar 30KB
cas-server-support-spnego-4.0.0.jar 21KB
cas-server-support-oauth-4.0.0.jar 20KB
cas-server-integration-memcached-4.0.0.jar 20KB
cas-server-extension-clearpass-4.0.0.jar 18KB
cas-server-support-openid-4.0.0.jar 18KB
cas-server-support-pac4j-4.0.0.jar 12KB
cas-server-integration-restlet-4.0.0.jar 11KB
cas-server-support-radius-4.0.0.jar 11KB
cas-server-support-trusted-4.0.0.jar 10KB
cas-server-integration-ehcache-4.0.0.jar 10KB
cas-server-support-legacy-4.0.0.jar 9KB
cas-server-support-jdbc-4.0.0.jar 9KB
cas-server-integration-jboss-4.0.0.jar 7KB
cas-server-support-generic-4.0.0.jar 7KB
CentralAuthenticationServiceImpl.java 29KB
CentralAuthenticationServiceImplTests.java 21KB
OAuth20AccessTokenControllerTests.java 16KB
EncryptedMapDecorator.java 15KB
RegisteredServiceSimpleFormControllerTests.java 14KB
PolicyBasedAuthenticationManager.java 13KB
AbstractRegisteredService.java 13KB
SimpleHttpClient.java 12KB
X509CredentialsAuthenticationHandlerTests.java 12KB
ServiceValidateControllerTests.java 11KB
JpaLockingStrategyTests.java 11KB
AuthenticationViaFormActionTests.java 11KB
共 892 条
- 1
- 2
- 3
- 4
- 5
- 6
- 9
资源评论
zangguangtian
- 粉丝: 4
- 资源: 1
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功