当前位置: 首页>>代码示例>>Java>>正文


Java TicketGrantingTicket.markTicketExpired方法代码示例

本文整理汇总了Java中org.jasig.cas.ticket.TicketGrantingTicket.markTicketExpired方法的典型用法代码示例。如果您正苦于以下问题:Java TicketGrantingTicket.markTicketExpired方法的具体用法?Java TicketGrantingTicket.markTicketExpired怎么用?Java TicketGrantingTicket.markTicketExpired使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.jasig.cas.ticket.TicketGrantingTicket的用法示例。


在下文中一共展示了TicketGrantingTicket.markTicketExpired方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: verifyUpdateOfRegistry

import org.jasig.cas.ticket.TicketGrantingTicket; //导入方法依赖的package包/类
@Test
public void verifyUpdateOfRegistry() {
    final TicketGrantingTicket t = new TicketGrantingTicketImpl("test",
            org.jasig.cas.authentication.TestUtils.getAuthentication(),
            new NeverExpiresExpirationPolicy());
    this.ticketRegistry.addTicket(t);
    final TicketGrantingTicket returned = (TicketGrantingTicket) this.ticketRegistry.getTicket("test");

    final ServiceTicket s = returned.grantServiceTicket("test2", org.jasig.cas.services.TestUtils.getService(),
            new NeverExpiresExpirationPolicy(), true, true);

    this.ticketRegistry.addTicket(s);
    final ServiceTicket s2 = (ServiceTicket) this.ticketRegistry.getTicket("test2");
    assertNotNull(s2.grantProxyGrantingTicket("ff", org.jasig.cas.authentication.TestUtils.getAuthentication(),
            new NeverExpiresExpirationPolicy()));

    assertTrue(s2.isValidFor(org.jasig.cas.services.TestUtils.getService()));
    assertTrue(this.wasTicketUpdated);

    returned.markTicketExpired();
    assertTrue(t.isExpired());
}
 
开发者ID:hsj-xiaokang,项目名称:springboot-shiro-cas-mybatis,代码行数:23,代码来源:DistributedTicketRegistryTests.java

示例2: verifyUpdateOfRegistry

import org.jasig.cas.ticket.TicketGrantingTicket; //导入方法依赖的package包/类
@Test
public void verifyUpdateOfRegistry() {
    final TicketGrantingTicket t = new TicketGrantingTicketImpl("test", TestUtils.getAuthentication(),
            new NeverExpiresExpirationPolicy());
    this.ticketRegistry.addTicket(t);
    final TicketGrantingTicket returned = (TicketGrantingTicket) this.ticketRegistry.getTicket("test");

    final ServiceTicket s = returned.grantServiceTicket("test2", TestUtils.getService(),
            new NeverExpiresExpirationPolicy(), true);

    this.ticketRegistry.addTicket(s);
    final ServiceTicket s2 = (ServiceTicket) this.ticketRegistry.getTicket("test2");
    assertNotNull(s2.grantTicketGrantingTicket("ff", TestUtils.getAuthentication(),
            new NeverExpiresExpirationPolicy()));

    assertTrue(s2.isValidFor(TestUtils.getService()));
    assertTrue(this.wasTicketUpdated);

    returned.markTicketExpired();
    assertTrue(t.isExpired());
}
 
开发者ID:hsj-xiaokang,项目名称:springboot-shiro-cas-mybatis,代码行数:22,代码来源:DistributedTicketRegistryTests.java

示例3: testUpdateOfRegistry

import org.jasig.cas.ticket.TicketGrantingTicket; //导入方法依赖的package包/类
@Test
public void testUpdateOfRegistry() {
    final TicketGrantingTicket t = new TicketGrantingTicketImpl("test", TestUtils.getAuthentication(),
            new NeverExpiresExpirationPolicy());
    this.ticketRegistry.addTicket(t);
    final TicketGrantingTicket returned = (TicketGrantingTicket) this.ticketRegistry.getTicket("test");

    final ServiceTicket s = returned.grantServiceTicket("test2", TestUtils.getService(),
            new NeverExpiresExpirationPolicy(), true);

    this.ticketRegistry.addTicket(s);
    final ServiceTicket s2 = (ServiceTicket) this.ticketRegistry.getTicket("test2");
    assertNotNull(s2.grantTicketGrantingTicket("ff", TestUtils.getAuthentication(),
            new NeverExpiresExpirationPolicy()));

    assertTrue(s2.isValidFor(TestUtils.getService()));
    assertTrue(this.wasTicketUpdated);

    returned.markTicketExpired();
    assertTrue(t.isExpired());
}
 
开发者ID:luotuo,项目名称:cas4.0.x-server-wechat,代码行数:22,代码来源:DistributedTicketRegistryTests.java

示例4: updateTicketShouldOverwriteTicketInStorage

import org.jasig.cas.ticket.TicketGrantingTicket; //导入方法依赖的package包/类
@Test
public void updateTicketShouldOverwriteTicketInStorage() {
    final Ticket ticket = getTicket();
    infinispanTicketRegistry.addTicket(ticket);
    assertFalse(infinispanTicketRegistry.getTicket(ticket.getId()).isExpired());
    final TicketGrantingTicket ticket2 = (TicketGrantingTicket) ticket;
    ticket2.markTicketExpired();
    infinispanTicketRegistry.addTicket(ticket);
    assertTrue(infinispanTicketRegistry.getTicket(ticket.getId()).isExpired());
}
 
开发者ID:hsj-xiaokang,项目名称:springboot-shiro-cas-mybatis,代码行数:11,代码来源:InfinispanTicketRegistryTests.java

示例5: verifyTGTThatIsExpired

import org.jasig.cas.ticket.TicketGrantingTicket; //导入方法依赖的package包/类
@Test(expected = FailedLoginException.class)
public void verifyTGTThatIsExpired() throws Exception {
    final OpenIdCredential c = new OpenIdCredential("test", "test");
    final TicketGrantingTicket t = getTicketGrantingTicket();
    this.ticketRegistry.addTicket(t);

    t.markTicketExpired();
    this.openIdCredentialsAuthenticationHandler.authenticate(c);
}
 
开发者ID:hsj-xiaokang,项目名称:springboot-shiro-cas-mybatis,代码行数:10,代码来源:OpenIdCredentialsAuthenticationHandlerTests.java

示例6: performLogout

import org.jasig.cas.ticket.TicketGrantingTicket; //导入方法依赖的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<>();
    // if SLO is not disabled
    if (!this.singleLogoutCallbacksDisabled) {
        // through all services
        for (final Map.Entry<String, Service> entry : services.entrySet()) {
            // it's a SingleLogoutService, else ignore
            final Service service = entry.getValue();
            if (service instanceof SingleLogoutService) {
                final LogoutRequest logoutRequest = handleLogoutForSloService((SingleLogoutService) service, entry.getKey());
                if (logoutRequest != null) {
                    LOGGER.debug("Captured logout request [{}]", logoutRequest);
                    logoutRequests.add(logoutRequest);
                }
            }
        }
    }

    return logoutRequests;
}
 
开发者ID:hsj-xiaokang,项目名称:springboot-shiro-cas-mybatis,代码行数:37,代码来源:LogoutManagerImpl.java

示例7: populateRegistryWithExpiredTickets

import org.jasig.cas.ticket.TicketGrantingTicket; //导入方法依赖的package包/类
protected void populateRegistryWithExpiredTickets() {
    for (int i = 0; i < 10; i++) {
        final TicketGrantingTicket ticket = new TicketGrantingTicketImpl("test" + i, TestUtils.getAuthentication(),
                new NeverExpiresExpirationPolicy());
        ticket.markTicketExpired();
        this.ticketRegistry.addTicket(ticket);
    }
}
 
开发者ID:hsj-xiaokang,项目名称:springboot-shiro-cas-mybatis,代码行数:9,代码来源:AbstractRegistryCleanerTests.java

示例8: populateRegistryWithExpiredTickets

import org.jasig.cas.ticket.TicketGrantingTicket; //导入方法依赖的package包/类
private void populateRegistryWithExpiredTickets() {
    for (int i = 0; i < 10; i++) {
        TicketGrantingTicket ticket = new TicketGrantingTicketImpl("test" + i, TestUtils.getAuthentication(),
                new NeverExpiresExpirationPolicy());
        ticket.markTicketExpired();
        this.ticketRegistry.addTicket(ticket);
    }
}
 
开发者ID:luotuo,项目名称:cas4.0.x-server-wechat,代码行数:9,代码来源:AbstractRegistryCleanerTests.java

示例9: testTGTThatIsExpired

import org.jasig.cas.ticket.TicketGrantingTicket; //导入方法依赖的package包/类
@Test(expected = FailedLoginException.class)
public void testTGTThatIsExpired() throws Exception {
    final OpenIdCredential c = new OpenIdCredential("test", "test");
    final TicketGrantingTicket t = getTicketGrantingTicket();
    this.ticketRegistry.addTicket(t);

    t.markTicketExpired();
    this.openIdCredentialsAuthenticationHandler.authenticate(c);
}
 
开发者ID:luotuo,项目名称:cas4.0.x-server-wechat,代码行数:10,代码来源:OpenIdCredentialsAuthenticationHandlerTests.java

示例10: populateRegistryWithExpiredTickets

import org.jasig.cas.ticket.TicketGrantingTicket; //导入方法依赖的package包/类
protected void populateRegistryWithExpiredTickets() {
    for (int i = 0; i < 10; i++) {
        final TicketGrantingTicket ticket = new TicketGrantingTicketImpl("test" + i,
                org.jasig.cas.authentication.TestUtils.getAuthentication(),
                new NeverExpiresExpirationPolicy());
        ticket.markTicketExpired();
        this.ticketRegistry.addTicket(ticket);
    }
}
 
开发者ID:yuweijun,项目名称:cas-server-4.2.1,代码行数:10,代码来源:AbstractRegistryCleanerTests.java

示例11: performLogout

import org.jasig.cas.ticket.TicketGrantingTicket; //导入方法依赖的package包/类
@Override
public List<LogoutRequest> performLogout(final TicketGrantingTicket ticket) {
    ticket.markTicketExpired();
    registry.updateTicket(ticket);
    return null;
}
 
开发者ID:hsj-xiaokang,项目名称:springboot-shiro-cas-mybatis,代码行数:7,代码来源:MockExpireUpdateTicketLogoutManager.java

示例12: performLogout

import org.jasig.cas.ticket.TicketGrantingTicket; //导入方法依赖的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.ticket.TicketGrantingTicket.markTicketExpired方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。