本文整理汇总了Java中org.jasig.cas.services.LogoutType类的典型用法代码示例。如果您正苦于以下问题:Java LogoutType类的具体用法?Java LogoutType怎么用?Java LogoutType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
LogoutType类属于org.jasig.cas.services包,在下文中一共展示了LogoutType类的16个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: read
import org.jasig.cas.services.LogoutType; //导入依赖的package包/类
@Override
public RegisteredService read(final Kryo kryo, final Input input, final Class<RegisteredService> type) {
final AbstractRegisteredService svc = new RegexRegisteredService();
svc.setServiceId(kryo.readObject(input, String.class));
svc.setName(kryo.readObject(input, String.class));
svc.setDescription(kryo.readObject(input, String.class));
svc.setId(kryo.readObject(input, Long.class));
svc.setEvaluationOrder(kryo.readObject(input, Integer.class));
svc.setLogo(kryo.readObject(input, URL.class));
svc.setLogoutType(kryo.readObject(input, LogoutType.class));
svc.setLogoutUrl(kryo.readObject(input, URL.class));
svc.setRequiredHandlers(kryo.readObject(input, ImmutableSet.class));
svc.setTheme(kryo.readObject(input, String.class));
svc.setPublicKey(readObjectByReflection(kryo, input, RegisteredServicePublicKey.class));
svc.setProxyPolicy(readObjectByReflection(kryo, input, RegisteredServiceProxyPolicy.class));
svc.setAttributeReleasePolicy(readObjectByReflection(kryo, input, RegisteredServiceAttributeReleasePolicy.class));
svc.setUsernameAttributeProvider(readObjectByReflection(kryo, input, RegisteredServiceUsernameAttributeProvider.class));
svc.setAccessStrategy(readObjectByReflection(kryo, input, RegisteredServiceAccessStrategy.class));
return svc;
}
开发者ID:hsj-xiaokang,项目名称:springboot-shiro-cas-mybatis,代码行数:23,代码来源:RegisteredServiceSerializer.java
示例2: read
import org.jasig.cas.services.LogoutType; //导入依赖的package包/类
@Override
public RegisteredService read(final Kryo kryo, final Input input, final Class<RegisteredService> type) {
final AbstractRegisteredService svc = new RegexRegisteredService();
svc.setServiceId(kryo.readObject(input, String.class));
svc.setName(kryo.readObject(input, String.class));
svc.setDescription(kryo.readObject(input, String.class));
svc.setId(kryo.readObject(input, Long.class));
svc.setEvaluationOrder(kryo.readObject(input, Integer.class));
svc.setLogo(kryo.readObject(input, URL.class));
svc.setLogoutType(kryo.readObject(input, LogoutType.class));
svc.setLogoutUrl(kryo.readObject(input, URL.class));
svc.setRequiredHandlers(kryo.readObject(input, ImmutableSet.class));
svc.setTheme(kryo.readObject(input, String.class));
svc.setPublicKey(readObjectByReflection(kryo, input, RegisteredServicePublicKey.class));
svc.setProxyPolicy(readObjectByReflection(kryo, input, RegisteredServiceProxyPolicy.class));
svc.setAttributeReleasePolicy(readObjectByReflection(kryo, input, AttributeReleasePolicy.class));
svc.setUsernameAttributeProvider(readObjectByReflection(kryo, input, RegisteredServiceUsernameAttributeProvider.class));
svc.setAccessStrategy(readObjectByReflection(kryo, input, RegisteredServiceAccessStrategy.class));
return svc;
}
开发者ID:xuchengdong,项目名称:cas4.1.9,代码行数:23,代码来源:RegisteredServiceSerializer.java
示例3: handleLogoutForSloService
import org.jasig.cas.services.LogoutType; //导入依赖的package包/类
/**
* Handle logout for slo service.
*
* @param singleLogoutService the service
* @param ticketId the ticket id
* @return the logout request
*/
private LogoutRequest handleLogoutForSloService(final SingleLogoutService singleLogoutService, final String ticketId) {
if (!singleLogoutService.isLoggedOutAlready()) {
final RegisteredService registeredService = servicesManager.findServiceBy(singleLogoutService);
if (serviceSupportsSingleLogout(registeredService)) {
final URL logoutUrl = determineLogoutUrl(registeredService, singleLogoutService);
final DefaultLogoutRequest logoutRequest = new DefaultLogoutRequest(ticketId, singleLogoutService, logoutUrl);
final LogoutType type = registeredService.getLogoutType() == null
? LogoutType.BACK_CHANNEL : registeredService.getLogoutType();
switch (type) {
case BACK_CHANNEL:
if (performBackChannelLogout(logoutRequest)) {
logoutRequest.setStatus(LogoutRequestStatus.SUCCESS);
} else {
logoutRequest.setStatus(LogoutRequestStatus.FAILURE);
LOGGER.warn("Logout message not sent to [{}]; Continuing processing...", singleLogoutService.getId());
}
break;
default:
logoutRequest.setStatus(LogoutRequestStatus.NOT_ATTEMPTED);
break;
}
return logoutRequest;
}
}
return null;
}
开发者ID:hsj-xiaokang,项目名称:springboot-shiro-cas-mybatis,代码行数:38,代码来源:LogoutManagerImpl.java
示例4: verifyLogoutTypeBack
import org.jasig.cas.services.LogoutType; //导入依赖的package包/类
@Test
public void verifyLogoutTypeBack() {
this.registeredService.setLogoutType(LogoutType.BACK_CHANNEL);
final Collection<LogoutRequest> logoutRequests = this.logoutManager.performLogout(tgt);
assertEquals(1, logoutRequests.size());
final LogoutRequest logoutRequest = logoutRequests.iterator().next();
assertEquals(ID, logoutRequest.getTicketId());
assertEquals(this.simpleWebApplicationServiceImpl, logoutRequest.getService());
assertEquals(LogoutRequestStatus.SUCCESS, logoutRequest.getStatus());
}
开发者ID:hsj-xiaokang,项目名称:springboot-shiro-cas-mybatis,代码行数:11,代码来源:LogoutManagerImplTests.java
示例5: verifyLogoutTypeFront
import org.jasig.cas.services.LogoutType; //导入依赖的package包/类
@Test
public void verifyLogoutTypeFront() {
this.registeredService.setLogoutType(LogoutType.FRONT_CHANNEL);
final Collection<LogoutRequest> logoutRequests = this.logoutManager.performLogout(tgt);
assertEquals(1, logoutRequests.size());
final LogoutRequest logoutRequest = logoutRequests.iterator().next();
assertEquals(ID, logoutRequest.getTicketId());
assertEquals(this.simpleWebApplicationServiceImpl, logoutRequest.getService());
assertEquals(LogoutRequestStatus.NOT_ATTEMPTED, logoutRequest.getStatus());
}
开发者ID:hsj-xiaokang,项目名称:springboot-shiro-cas-mybatis,代码行数:11,代码来源:LogoutManagerImplTests.java
示例6: verifyAsynchronousLogout
import org.jasig.cas.services.LogoutType; //导入依赖的package包/类
@Test
public void verifyAsynchronousLogout() {
this.registeredService.setLogoutType(LogoutType.BACK_CHANNEL);
this.logoutManager.setAsynchronous(false);
final Collection<LogoutRequest> logoutRequests = this.logoutManager.performLogout(tgt);
assertEquals(1, logoutRequests.size());
}
开发者ID:hsj-xiaokang,项目名称:springboot-shiro-cas-mybatis,代码行数:8,代码来源:LogoutManagerImplTests.java
示例7: getRegisteredService
import org.jasig.cas.services.LogoutType; //导入依赖的package包/类
private RegisteredService getRegisteredService() throws MalformedURLException {
final RegisteredServiceImpl svc = new RegisteredServiceImpl();
svc.setServiceId("https://www.github.com");
svc.setLogoutUrl(new URL("https://www.google.com"));
svc.setName("Service logout test");
svc.setLogoutType(LogoutType.FRONT_CHANNEL);
svc.setAccessStrategy(new DefaultRegisteredServiceAccessStrategy(true, true));
return svc;
}
开发者ID:hsj-xiaokang,项目名称:springboot-shiro-cas-mybatis,代码行数:10,代码来源:FrontChannelLogoutActionTests.java
示例8: parseLogoutType
import org.jasig.cas.services.LogoutType; //导入依赖的package包/类
/**
* Parse raw logout type string to {@link LogoutType}.
*
* @param logoutType the reg svc
*/
private LogoutType parseLogoutType(final String logoutType) {
if (StringUtils.equalsIgnoreCase(logoutType, RegisteredServiceLogoutTypeEditBean.BACK.toString())) {
return LogoutType.BACK_CHANNEL;
} else if (StringUtils.equalsIgnoreCase(logoutType, RegisteredServiceLogoutTypeEditBean.FRONT.toString())) {
return LogoutType.FRONT_CHANNEL;
} else {
return LogoutType.NONE;
}
}
开发者ID:hsj-xiaokang,项目名称:springboot-shiro-cas-mybatis,代码行数:15,代码来源:DefaultRegisteredServiceMapper.java
示例9: getRegisteredService
import org.jasig.cas.services.LogoutType; //导入依赖的package包/类
public static AbstractRegisteredService getRegisteredService(final String id) {
try {
final RegexRegisteredService s = new RegexRegisteredService();
s.setServiceId(id);
s.setEvaluationOrder(1);
s.setName("Test registered service");
s.setDescription("Registered service description");
s.setProxyPolicy(new RegexMatchingRegisteredServiceProxyPolicy("^https?://.+"));
s.setId(new SecureRandom().nextInt(Math.abs(s.hashCode())));
s.setTheme("exampleTheme");
s.setUsernameAttributeProvider(new PrincipalAttributeRegisteredServiceUsernameProvider("uid"));
final DefaultRegisteredServiceAccessStrategy accessStrategy =
new DefaultRegisteredServiceAccessStrategy(true, true);
accessStrategy.setRequireAllAttributes(true);
accessStrategy.setRequiredAttributes(getTestAttributes());
s.setAccessStrategy(accessStrategy);
s.setLogo(new URL("https://logo.example.org/logo.png"));
s.setLogoutType(LogoutType.BACK_CHANNEL);
s.setLogoutUrl(new URL("https://sys.example.org/logout.png"));
s.setProxyPolicy(new RegexMatchingRegisteredServiceProxyPolicy("^http.+"));
s.setPublicKey(new RegisteredServicePublicKeyImpl("classpath:pub.key", "RSA"));
final ReturnAllowedAttributeReleasePolicy policy = new ReturnAllowedAttributeReleasePolicy();
policy.setAuthorizedToReleaseCredentialPassword(true);
policy.setAuthorizedToReleaseProxyGrantingTicket(true);
final CachingPrincipalAttributesRepository repo =
new CachingPrincipalAttributesRepository(new StubPersonAttributeDao(), 10);
repo.setMergingStrategy(new NoncollidingAttributeAdder());
policy.setPrincipalAttributesRepository(repo);
policy.setAttributeFilter(new RegisteredServiceRegexAttributeFilter("https://.+"));
policy.setAllowedAttributes(new ArrayList(getTestAttributes().keySet()));
s.setAttributeReleasePolicy(policy);
return s;
} catch (final Exception e) {
throw new RuntimeException(e);
}
}
开发者ID:hsj-xiaokang,项目名称:springboot-shiro-cas-mybatis,代码行数:41,代码来源:TestUtils.java
示例10: testLogoutTypeBack
import org.jasig.cas.services.LogoutType; //导入依赖的package包/类
@Test
public void testLogoutTypeBack() {
this.registeredService.setLogoutType(LogoutType.BACK_CHANNEL);
final Collection<LogoutRequest> logoutRequests = this.logoutManager.performLogout(tgt);
assertEquals(1, logoutRequests.size());
final LogoutRequest logoutRequest = logoutRequests.iterator().next();
assertEquals(ID, logoutRequest.getTicketId());
assertEquals(this.simpleWebApplicationServiceImpl, logoutRequest.getService());
assertEquals(LogoutRequestStatus.SUCCESS, logoutRequest.getStatus());
}
开发者ID:luotuo,项目名称:cas4.0.x-server-wechat,代码行数:11,代码来源:LogoutManagerImplTests.java
示例11: testLogoutTypeFront
import org.jasig.cas.services.LogoutType; //导入依赖的package包/类
@Test
public void testLogoutTypeFront() {
this.registeredService.setLogoutType(LogoutType.FRONT_CHANNEL);
final Collection<LogoutRequest> logoutRequests = this.logoutManager.performLogout(tgt);
assertEquals(1, logoutRequests.size());
final LogoutRequest logoutRequest = logoutRequests.iterator().next();
assertEquals(ID, logoutRequest.getTicketId());
assertEquals(this.simpleWebApplicationServiceImpl, logoutRequest.getService());
assertEquals(LogoutRequestStatus.NOT_ATTEMPTED, logoutRequest.getStatus());
}
开发者ID:luotuo,项目名称:cas4.0.x-server-wechat,代码行数:11,代码来源:LogoutManagerImplTests.java
示例12: getRegisteredService
import org.jasig.cas.services.LogoutType; //导入依赖的package包/类
public static AbstractRegisteredService getRegisteredService(final String id) {
try {
final RegexRegisteredService s = new RegexRegisteredService();
s.setServiceId(id);
s.setEvaluationOrder(1);
s.setName("Test registered service");
s.setDescription("Registered service description");
s.setProxyPolicy(new RegexMatchingRegisteredServiceProxyPolicy("^https?://.+"));
s.setId(new SecureRandom().nextInt(Math.abs(s.hashCode())));
s.setTheme("exampleTheme");
s.setUsernameAttributeProvider(new PrincipalAttributeRegisteredServiceUsernameProvider("uid"));
final DefaultRegisteredServiceAccessStrategy accessStrategy =
new DefaultRegisteredServiceAccessStrategy(true, true);
accessStrategy.setRequireAllAttributes(true);
accessStrategy.setRequiredAttributes(getTestAttributes());
s.setAccessStrategy(accessStrategy);
s.setLogo(new URL("https://logo.example.org/logo.png"));
s.setLogoutType(LogoutType.BACK_CHANNEL);
s.setLogoutUrl(new URL("https://sys.example.org/logout.png"));
s.setProxyPolicy(new RegexMatchingRegisteredServiceProxyPolicy("^http.+"));
s.setPublicKey(new RegisteredServicePublicKeyImpl("classpath:pub.key", "RSA"));
final ReturnAllowedAttributeReleasePolicy policy = new ReturnAllowedAttributeReleasePolicy();
policy.setAuthorizedToReleaseCredentialPassword(true);
policy.setAuthorizedToReleaseProxyGrantingTicket(true);
final CachingPrincipalAttributesRepository repo =
new CachingPrincipalAttributesRepository(10);
repo.setMergingStrategy(CachingPrincipalAttributesRepository.MergingStrategy.ADD);
policy.setPrincipalAttributesRepository(repo);
policy.setAttributeFilter(new RegisteredServiceRegexAttributeFilter("https://.+"));
policy.setAllowedAttributes(new ArrayList(getTestAttributes().keySet()));
s.setAttributeReleasePolicy(policy);
return s;
} catch (final Exception e) {
throw new RuntimeException(e);
}
}
开发者ID:xuchengdong,项目名称:cas4.1.9,代码行数:41,代码来源:TestUtils.java
示例13: verifyLogoutTypeNone
import org.jasig.cas.services.LogoutType; //导入依赖的package包/类
@Test
public void verifyLogoutTypeNone() {
this.registeredService.setLogoutType(LogoutType.NONE);
final Collection<LogoutRequest> logoutRequests = this.logoutManager.performLogout(tgt);
assertEquals(0, logoutRequests.size());
}
开发者ID:hsj-xiaokang,项目名称:springboot-shiro-cas-mybatis,代码行数:7,代码来源:LogoutManagerImplTests.java
示例14: mapRegisteredService
import org.jasig.cas.services.LogoutType; //导入依赖的package包/类
@Override
public void mapRegisteredService(final RegisteredService svc, final ServiceData bean) {
bean.setAssignedId(Long.toString(svc.getId()));
bean.setServiceId(svc.getServiceId());
bean.setName(svc.getName());
bean.setDescription(svc.getDescription());
if (svc.getLogo() != null) {
bean.setLogoUrl(svc.getLogo().toExternalForm());
}
bean.setRequiredHandlers(svc.getRequiredHandlers());
if (svc instanceof OAuthRegisteredCallbackAuthorizeService) {
bean.setType(RegisteredServiceTypeEditBean.OAUTH_CALLBACK_AUTHZ.toString());
}
if (svc instanceof OAuthRegisteredService) {
bean.setType(RegisteredServiceTypeEditBean.OAUTH.toString());
final OAuthRegisteredService oauth = (OAuthRegisteredService) svc;
final RegisteredServiceOAuthTypeEditBean oauthBean = bean.getOauth();
oauthBean.setBypass(oauth.isBypassApprovalPrompt());
oauthBean.setClientId(oauth.getClientId());
oauthBean.setClientSecret(oauth.getClientSecret());
}
bean.setTheme(svc.getTheme());
bean.setEvalOrder(svc.getEvaluationOrder());
final LogoutType logoutType = svc.getLogoutType();
switch (logoutType) {
case BACK_CHANNEL:
bean.setLogoutType(RegisteredServiceLogoutTypeEditBean.BACK.toString());
break;
case FRONT_CHANNEL:
bean.setLogoutType(RegisteredServiceLogoutTypeEditBean.FRONT.toString());
break;
default:
bean.setLogoutType(RegisteredServiceLogoutTypeEditBean.NONE.toString());
break;
}
final URL url = svc.getLogoutUrl();
if (url != null) {
bean.setLogoutUrl(url.toExternalForm());
}
final RegisteredServicePublicKey key = svc.getPublicKey();
final RegisteredServicePublicKeyEditBean pBean = bean.getPublicKey();
if (key != null) {
pBean.setAlgorithm(key.getAlgorithm());
pBean.setLocation(key.getLocation());
}
}
开发者ID:hsj-xiaokang,项目名称:springboot-shiro-cas-mybatis,代码行数:51,代码来源:DefaultRegisteredServiceMapper.java
示例15: fromRegisteredService
import org.jasig.cas.services.LogoutType; //导入依赖的package包/类
/**
* From registered service to a service bean.
*
* @param svc the svc
* @return the registered service bean
*/
public static RegisteredServiceEditBean fromRegisteredService(final RegisteredService svc) {
final RegisteredServiceEditBean serviceBean = new RegisteredServiceEditBean();
final ServiceData bean = serviceBean.getServiceData();
bean.setAssignedId(svc.getId());
bean.setServiceId(svc.getServiceId());
bean.setName(svc.getName());
bean.setDescription(svc.getDescription());
if (svc.getLogo() != null) {
bean.setLogoUrl(svc.getLogo().toExternalForm());
}
bean.setRequiredHandlers(svc.getRequiredHandlers());
configureAccessStrategy(svc, bean);
if (svc instanceof OAuthRegisteredCallbackAuthorizeService) {
bean.setType(RegisteredServiceTypeEditBean.OAUTH_CALLBACK_AUTHZ.toString());
}
if (svc instanceof OAuthRegisteredService) {
bean.setType(RegisteredServiceTypeEditBean.OAUTH.toString());
final OAuthRegisteredService oauth = (OAuthRegisteredService) svc;
final RegisteredServiceOAuthTypeEditBean oauthBean = bean.getOauth();
oauthBean.setBypass(oauth.isBypassApprovalPrompt());
oauthBean.setClientId(oauth.getClientId());
oauthBean.setClientSecret(oauth.getClientSecret());
}
bean.setTheme(svc.getTheme());
bean.setEvalOrder(svc.getEvaluationOrder());
final LogoutType logoutType = svc.getLogoutType();
switch (logoutType) {
case BACK_CHANNEL:
bean.setLogoutType(RegisteredServiceLogoutTypeEditBean.BACK.toString());
break;
case FRONT_CHANNEL:
bean.setLogoutType(RegisteredServiceLogoutTypeEditBean.FRONT.toString());
break;
default:
bean.setLogoutType(RegisteredServiceLogoutTypeEditBean.NONE.toString());
break;
}
final URL url = svc.getLogoutUrl();
if (url != null) {
bean.setLogoutUrl(url.toExternalForm());
}
final RegisteredServiceUsernameAttributeProvider provider = svc.getUsernameAttributeProvider();
final RegisteredServiceUsernameAttributeProviderEditBean uBean = bean.getUserAttrProvider();
configureUsernameAttributeProvider(provider, uBean);
final RegisteredServicePublicKey key = svc.getPublicKey();
final RegisteredServicePublicKeyEditBean pBean = bean.getPublicKey();
if (key != null) {
pBean.setAlgorithm(key.getAlgorithm());
pBean.setLocation(key.getLocation());
}
configureProxyPolicy(svc, bean);
configureAttributeReleasePolicy(svc, bean);
return serviceBean;
}
开发者ID:hsj-xiaokang,项目名称:springboot-shiro-cas-mybatis,代码行数:68,代码来源:RegisteredServiceEditBean.java
示例16: performLogout
import org.jasig.cas.services.LogoutType; //导入依赖的package包/类
/**
* Perform a back channel logout for a given ticket granting ticket and returns all the logout requests.
*
* @param ticket a given ticket granting ticket.
* @return all logout requests.
*/
@Override
public List<LogoutRequest> performLogout(final TicketGrantingTicket ticket) {
final Map<String, Service> services;
// synchronize the retrieval of the services and their cleaning for the TGT
// to avoid concurrent logout mess ups
synchronized (ticket) {
services = ticket.getServices();
ticket.removeAllServices();
}
ticket.markTicketExpired();
final List<LogoutRequest> logoutRequests = new ArrayList<LogoutRequest>();
// if SLO is not disabled
if (!disableSingleSignOut) {
// through all services
for (final String ticketId : services.keySet()) {
final Service service = services.get(ticketId);
// it's a SingleLogoutService, else ignore
if (service instanceof SingleLogoutService) {
final SingleLogoutService singleLogoutService = (SingleLogoutService) service;
// the logout has not performed already
if (!singleLogoutService.isLoggedOutAlready()) {
final LogoutRequest logoutRequest = new LogoutRequest(ticketId, singleLogoutService);
// always add the logout request
logoutRequests.add(logoutRequest);
final RegisteredService registeredService = servicesManager.findServiceBy(service);
// the service is no more defined, or the logout type is not defined or is back channel
if (registeredService == null || registeredService.getLogoutType() == null
|| registeredService.getLogoutType() == LogoutType.BACK_CHANNEL) {
// perform back channel logout
if (performBackChannelLogout(logoutRequest)) {
logoutRequest.setStatus(LogoutRequestStatus.SUCCESS);
} else {
logoutRequest.setStatus(LogoutRequestStatus.FAILURE);
LOGGER.warn("Logout message not sent to [{}]; Continuing processing...",
singleLogoutService.getId());
}
}
}
}
}
}
return logoutRequests;
}
开发者ID:luotuo,项目名称:cas4.0.x-server-wechat,代码行数:52,代码来源:LogoutManagerImpl.java
注:本文中的org.jasig.cas.services.LogoutType类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论