本文整理汇总了Java中org.jasig.cas.util.DefaultUniqueTicketIdGenerator类的典型用法代码示例。如果您正苦于以下问题:Java DefaultUniqueTicketIdGenerator类的具体用法?Java DefaultUniqueTicketIdGenerator怎么用?Java DefaultUniqueTicketIdGenerator使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DefaultUniqueTicketIdGenerator类属于org.jasig.cas.util包,在下文中一共展示了DefaultUniqueTicketIdGenerator类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setUp
import org.jasig.cas.util.DefaultUniqueTicketIdGenerator; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
this.ticketRegistry = new DefaultTicketRegistry();
final OpenIdCredentialsAuthenticationHandler handler = new OpenIdCredentialsAuthenticationHandler();
handler.setTicketRegistry(this.ticketRegistry);
this.authenticationManager = new PolicyBasedAuthenticationManager(
Collections.<AuthenticationHandler, PrincipalResolver>singletonMap(
handler,
new OpenIdPrincipalResolver()));
final Map<String, UniqueTicketIdGenerator> generator = new HashMap<>();
generator.put(OpenIdService.class.getName(), new DefaultUniqueTicketIdGenerator());
impl = new CentralAuthenticationServiceImpl(this.ticketRegistry, null, this.authenticationManager,
new DefaultUniqueTicketIdGenerator(), generator, new NeverExpiresExpirationPolicy(),
new NeverExpiresExpirationPolicy(),
new DefaultServicesManagerImpl(new InMemoryServiceRegistryDaoImpl()), mock(LogoutManager.class));
this.action = new OpenIdSingleSignOnAction();
this.action.setCentralAuthenticationService(this.impl);
this.action.setExtractor(new DefaultOpenIdUserNameExtractor());
this.action.afterPropertiesSet();
}
开发者ID:hsj-xiaokang,项目名称:springboot-shiro-cas-mybatis,代码行数:24,代码来源:OpenIdSingleSignOnActionTests.java
示例2: setUp
import org.jasig.cas.util.DefaultUniqueTicketIdGenerator; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
this.action = new PrincipalFromRequestRemoteUserNonInteractiveCredentialsAction();
final Map<String, UniqueTicketIdGenerator> idGenerators = new HashMap<>();
idGenerators.put(SimpleWebApplicationServiceImpl.class.getName(), new DefaultUniqueTicketIdGenerator());
final AuthenticationManager authenticationManager = new PolicyBasedAuthenticationManager(
Collections.<AuthenticationHandler, PrincipalResolver>singletonMap(
new PrincipalBearingCredentialsAuthenticationHandler(),
new PrincipalBearingPrincipalResolver()));
final CentralAuthenticationServiceImpl centralAuthenticationService = new CentralAuthenticationServiceImpl(
new DefaultTicketRegistry(), null, authenticationManager, new DefaultUniqueTicketIdGenerator(),
idGenerators, new NeverExpiresExpirationPolicy(), new NeverExpiresExpirationPolicy(),
mock(ServicesManager.class), mock(LogoutManager.class));
this.action.setCentralAuthenticationService(centralAuthenticationService);
}
开发者ID:hsj-xiaokang,项目名称:springboot-shiro-cas-mybatis,代码行数:19,代码来源:PrincipalFromRequestRemoteUserNonInteractiveCredentialsActionTests.java
示例3: setUp
import org.jasig.cas.util.DefaultUniqueTicketIdGenerator; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
this.action = new PrincipalFromRequestUserPrincipalNonInteractiveCredentialsAction();
final Map<String, UniqueTicketIdGenerator> idGenerators = new HashMap<>();
idGenerators.put(SimpleWebApplicationServiceImpl.class.getName(), new DefaultUniqueTicketIdGenerator());
final AuthenticationManager authenticationManager = new PolicyBasedAuthenticationManager(
Collections.<AuthenticationHandler, PrincipalResolver>singletonMap(
new PrincipalBearingCredentialsAuthenticationHandler(),
new PrincipalBearingPrincipalResolver()));
final CentralAuthenticationServiceImpl centralAuthenticationService = new CentralAuthenticationServiceImpl(
new DefaultTicketRegistry(), null, authenticationManager, new DefaultUniqueTicketIdGenerator(),
idGenerators, new NeverExpiresExpirationPolicy(), new NeverExpiresExpirationPolicy(),
mock(ServicesManager.class), mock(LogoutManager.class));
this.action.setCentralAuthenticationService(centralAuthenticationService);
}
开发者ID:hsj-xiaokang,项目名称:springboot-shiro-cas-mybatis,代码行数:21,代码来源:PrincipalFromRequestUserPrincipalNonInteractiveCredentialsActionTests.java
示例4: setUp
import org.jasig.cas.util.DefaultUniqueTicketIdGenerator; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
this.action = new X509CertificateCredentialsNonInteractiveAction();
final Map<String, UniqueTicketIdGenerator> idGenerators = new HashMap<>();
idGenerators.put(SimpleWebApplicationServiceImpl.class.getName(), new DefaultUniqueTicketIdGenerator());
final X509CredentialsAuthenticationHandler handler = new X509CredentialsAuthenticationHandler();
handler.setTrustedIssuerDnPattern("CN=\\w+,DC=jasig,DC=org");
final AuthenticationManager authenticationManager = new PolicyBasedAuthenticationManager(
Collections.<AuthenticationHandler, PrincipalResolver>singletonMap(
handler, new X509SerialNumberPrincipalResolver()));
final CentralAuthenticationServiceImpl centralAuthenticationService = new CentralAuthenticationServiceImpl(
new DefaultTicketRegistry(), null, authenticationManager, new DefaultUniqueTicketIdGenerator(),
idGenerators, new NeverExpiresExpirationPolicy(), new NeverExpiresExpirationPolicy(),
mock(ServicesManager.class), mock(LogoutManager.class));
this.action.setCentralAuthenticationService(centralAuthenticationService);
this.action.afterPropertiesSet();
}
开发者ID:hsj-xiaokang,项目名称:springboot-shiro-cas-mybatis,代码行数:23,代码来源:X509CertificateCredentialsNonInteractiveActionTests.java
示例5: setUp
import org.jasig.cas.util.DefaultUniqueTicketIdGenerator; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
this.ticketRegistry = new DefaultTicketRegistry();
final OpenIdCredentialsAuthenticationHandler handler = new OpenIdCredentialsAuthenticationHandler();
handler.setTicketRegistry(this.ticketRegistry);
this.authenticationManager = new PolicyBasedAuthenticationManager(
Collections.<AuthenticationHandler, PrincipalResolver>singletonMap(
handler,
new OpenIdPrincipalResolver()));
final Map<String, UniqueTicketIdGenerator> generator = new HashMap<String, UniqueTicketIdGenerator>();
generator.put(OpenIdService.class.getName(), new DefaultUniqueTicketIdGenerator());
impl = new CentralAuthenticationServiceImpl(this.ticketRegistry, null, this.authenticationManager,
new DefaultUniqueTicketIdGenerator(), generator, new NeverExpiresExpirationPolicy(),
new NeverExpiresExpirationPolicy(),
new DefaultServicesManagerImpl(new InMemoryServiceRegistryDaoImpl()), mock(LogoutManager.class));
this.action = new OpenIdSingleSignOnAction();
this.action.setCentralAuthenticationService(this.impl);
this.action.setExtractor(new DefaultOpenIdUserNameExtractor());
this.action.afterPropertiesSet();
}
示例6: setUp
import org.jasig.cas.util.DefaultUniqueTicketIdGenerator; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
this.action = new PrincipalFromRequestRemoteUserNonInteractiveCredentialsAction();
final Map<String, UniqueTicketIdGenerator> idGenerators = new HashMap<String, UniqueTicketIdGenerator>();
idGenerators.put(SimpleWebApplicationServiceImpl.class.getName(), new DefaultUniqueTicketIdGenerator());
final AuthenticationManager authenticationManager = new PolicyBasedAuthenticationManager(
Collections.<AuthenticationHandler, PrincipalResolver>singletonMap(
new PrincipalBearingCredentialsAuthenticationHandler(),
new PrincipalBearingPrincipalResolver()));
final CentralAuthenticationServiceImpl centralAuthenticationService = new CentralAuthenticationServiceImpl(
new DefaultTicketRegistry(), null, authenticationManager, new DefaultUniqueTicketIdGenerator(),
idGenerators, new NeverExpiresExpirationPolicy(), new NeverExpiresExpirationPolicy(),
mock(ServicesManager.class), mock(LogoutManager.class));
this.action.setCentralAuthenticationService(centralAuthenticationService);
}
开发者ID:luotuo,项目名称:cas4.0.x-server-wechat,代码行数:19,代码来源:PrincipalFromRequestRemoteUserNonInteractiveCredentialsActionTests.java
示例7: setUp
import org.jasig.cas.util.DefaultUniqueTicketIdGenerator; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
this.action = new PrincipalFromRequestUserPrincipalNonInteractiveCredentialsAction();
final Map<String, UniqueTicketIdGenerator> idGenerators = new HashMap<String, UniqueTicketIdGenerator>();
idGenerators.put(SimpleWebApplicationServiceImpl.class.getName(), new DefaultUniqueTicketIdGenerator());
final AuthenticationManager authenticationManager = new PolicyBasedAuthenticationManager(
Collections.<AuthenticationHandler, PrincipalResolver>singletonMap(
new PrincipalBearingCredentialsAuthenticationHandler(),
new PrincipalBearingPrincipalResolver()));
final CentralAuthenticationServiceImpl centralAuthenticationService = new CentralAuthenticationServiceImpl(
new DefaultTicketRegistry(), null, authenticationManager, new DefaultUniqueTicketIdGenerator(),
idGenerators, new NeverExpiresExpirationPolicy(), new NeverExpiresExpirationPolicy(),
mock(ServicesManager.class), mock(LogoutManager.class));
this.action.setCentralAuthenticationService(centralAuthenticationService);
}
开发者ID:luotuo,项目名称:cas4.0.x-server-wechat,代码行数:21,代码来源:PrincipalFromRequestUserPrincipalNonInteractiveCredentialsActionTests.java
示例8: setUp
import org.jasig.cas.util.DefaultUniqueTicketIdGenerator; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
this.action = new X509CertificateCredentialsNonInteractiveAction();
final Map<String, UniqueTicketIdGenerator> idGenerators = new HashMap<String, UniqueTicketIdGenerator>();
idGenerators.put(SimpleWebApplicationServiceImpl.class.getName(), new DefaultUniqueTicketIdGenerator());
final X509CredentialsAuthenticationHandler handler = new X509CredentialsAuthenticationHandler();
handler.setTrustedIssuerDnPattern("CN=\\w+,DC=jasig,DC=org");
final AuthenticationManager authenticationManager = new PolicyBasedAuthenticationManager(
Collections.<AuthenticationHandler, PrincipalResolver>singletonMap(
handler, new X509SerialNumberPrincipalResolver()));
final CentralAuthenticationServiceImpl centralAuthenticationService = new CentralAuthenticationServiceImpl(
new DefaultTicketRegistry(), null, authenticationManager, new DefaultUniqueTicketIdGenerator(),
idGenerators, new NeverExpiresExpirationPolicy(), new NeverExpiresExpirationPolicy(),
mock(ServicesManager.class), mock(LogoutManager.class));
this.action.setCentralAuthenticationService(centralAuthenticationService);
this.action.afterPropertiesSet();
}
开发者ID:luotuo,项目名称:cas4.0.x-server-wechat,代码行数:23,代码来源:X509CertificateCredentialsNonInteractiveActionTests.java
示例9: setUp
import org.jasig.cas.util.DefaultUniqueTicketIdGenerator; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
this.ticketRegistry = new DefaultTicketRegistry();
final OpenIdCredentialsAuthenticationHandler handler = new OpenIdCredentialsAuthenticationHandler();
handler.setTicketRegistry(this.ticketRegistry);
this.authenticationManager = new PolicyBasedAuthenticationManager(
Collections.<AuthenticationHandler, PrincipalResolver>singletonMap(
handler,
new OpenIdPrincipalResolver()));
final Map<String, UniqueTicketIdGenerator> generator = new HashMap<>();
generator.put(OpenIdService.class.getName(), new DefaultUniqueTicketIdGenerator());
impl = new CentralAuthenticationServiceImpl(this.ticketRegistry, this.authenticationManager,
new DefaultUniqueTicketIdGenerator(), generator, new NeverExpiresExpirationPolicy(),
new NeverExpiresExpirationPolicy(),
new DefaultServicesManagerImpl(new InMemoryServiceRegistryDaoImpl()), mock(LogoutManager.class));
this.action = new OpenIdSingleSignOnAction();
this.action.setCentralAuthenticationService(this.impl);
this.action.setExtractor(new DefaultOpenIdUserNameExtractor());
this.action.afterPropertiesSet();
}
示例10: setUp
import org.jasig.cas.util.DefaultUniqueTicketIdGenerator; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
this.action = new PrincipalFromRequestRemoteUserNonInteractiveCredentialsAction();
final Map<String, UniqueTicketIdGenerator> idGenerators = new HashMap<>();
idGenerators.put(SimpleWebApplicationServiceImpl.class.getName(), new DefaultUniqueTicketIdGenerator());
final AuthenticationManager authenticationManager = new PolicyBasedAuthenticationManager(
Collections.<AuthenticationHandler, PrincipalResolver>singletonMap(
new PrincipalBearingCredentialsAuthenticationHandler(),
new PrincipalBearingPrincipalResolver()));
final CentralAuthenticationServiceImpl centralAuthenticationService = new CentralAuthenticationServiceImpl(
new DefaultTicketRegistry(), authenticationManager, new DefaultUniqueTicketIdGenerator(),
idGenerators, new NeverExpiresExpirationPolicy(), new NeverExpiresExpirationPolicy(),
mock(ServicesManager.class), mock(LogoutManager.class));
this.action.setCentralAuthenticationService(centralAuthenticationService);
}
开发者ID:xuchengdong,项目名称:cas4.1.9,代码行数:19,代码来源:PrincipalFromRequestRemoteUserNonInteractiveCredentialsActionTests.java
示例11: setUp
import org.jasig.cas.util.DefaultUniqueTicketIdGenerator; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
this.action = new PrincipalFromRequestUserPrincipalNonInteractiveCredentialsAction();
final Map<String, UniqueTicketIdGenerator> idGenerators = new HashMap<>();
idGenerators.put(SimpleWebApplicationServiceImpl.class.getName(), new DefaultUniqueTicketIdGenerator());
final AuthenticationManager authenticationManager = new PolicyBasedAuthenticationManager(
Collections.<AuthenticationHandler, PrincipalResolver>singletonMap(
new PrincipalBearingCredentialsAuthenticationHandler(),
new PrincipalBearingPrincipalResolver()));
final CentralAuthenticationServiceImpl centralAuthenticationService = new CentralAuthenticationServiceImpl(
new DefaultTicketRegistry(), authenticationManager, new DefaultUniqueTicketIdGenerator(),
idGenerators, new NeverExpiresExpirationPolicy(), new NeverExpiresExpirationPolicy(),
mock(ServicesManager.class), mock(LogoutManager.class));
this.action.setCentralAuthenticationService(centralAuthenticationService);
}
开发者ID:xuchengdong,项目名称:cas4.1.9,代码行数:21,代码来源:PrincipalFromRequestUserPrincipalNonInteractiveCredentialsActionTests.java
示例12: setUp
import org.jasig.cas.util.DefaultUniqueTicketIdGenerator; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
this.action = new X509CertificateCredentialsNonInteractiveAction();
final Map<String, UniqueTicketIdGenerator> idGenerators = new HashMap<>();
idGenerators.put(SimpleWebApplicationServiceImpl.class.getName(), new DefaultUniqueTicketIdGenerator());
final X509CredentialsAuthenticationHandler handler = new X509CredentialsAuthenticationHandler();
handler.setTrustedIssuerDnPattern("CN=\\w+,DC=jasig,DC=org");
final AuthenticationManager authenticationManager = new PolicyBasedAuthenticationManager(
Collections.<AuthenticationHandler, PrincipalResolver>singletonMap(
handler, new X509SerialNumberPrincipalResolver()));
final CentralAuthenticationServiceImpl centralAuthenticationService = new CentralAuthenticationServiceImpl(
new DefaultTicketRegistry(), authenticationManager, new DefaultUniqueTicketIdGenerator(),
idGenerators, new NeverExpiresExpirationPolicy(), new NeverExpiresExpirationPolicy(),
mock(ServicesManager.class), mock(LogoutManager.class));
this.action.setCentralAuthenticationService(centralAuthenticationService);
this.action.afterPropertiesSet();
}
开发者ID:xuchengdong,项目名称:cas4.1.9,代码行数:23,代码来源:X509CertificateCredentialsNonInteractiveActionTests.java
示例13: setUp
import org.jasig.cas.util.DefaultUniqueTicketIdGenerator; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
this.handler = new Cas20ProxyHandler();
final SimpleHttpClientFactoryBean factory = new SimpleHttpClientFactoryBean();
factory.setConnectionTimeout(10000);
factory.setReadTimeout(10000);
this.handler.setHttpClient(factory.getObject());
this.handler.setUniqueTicketIdGenerator(new DefaultUniqueTicketIdGenerator());
when(this.proxyGrantingTicket.getId()).thenReturn("proxyGrantingTicket");
}
示例14: prepareNewCAS
import org.jasig.cas.util.DefaultUniqueTicketIdGenerator; //导入依赖的package包/类
@Before
public void prepareNewCAS() {
this.authentication = mock(Authentication.class);
when(this.authentication.getAuthenticationDate()).thenReturn(new Date());
final CredentialMetaData metadata = new BasicCredentialMetaData(TestUtils.getCredentialsWithSameUsernameAndPassword("principal"));
final Map<String, HandlerResult> successes = new HashMap<>();
successes.put("handler1", new DefaultHandlerResult(mock(AuthenticationHandler.class), metadata));
when(this.authentication.getCredentials()).thenReturn(Arrays.asList(metadata));
when(this.authentication.getSuccesses()).thenReturn(successes);
when(this.authentication.getPrincipal()).thenReturn(new DefaultPrincipalFactory().createPrincipal(PRINCIPAL));
final Service service1 = TestUtils.getService(SVC1_ID);
final ServiceTicket stMock = createMockServiceTicket(ST_ID, service1);
final TicketGrantingTicket tgtRootMock = createRootTicketGrantingTicket();
final TicketGrantingTicket tgtMock = createMockTicketGrantingTicket(TGT_ID, stMock, false,
tgtRootMock, new ArrayList<Authentication>());
when(tgtMock.getProxiedBy()).thenReturn(TestUtils.getService("proxiedBy"));
final List<Authentication> authnListMock = mock(List.class);
//Size is required to be 2, so that we can simulate proxying capabilities
when(authnListMock.size()).thenReturn(2);
when(authnListMock.get(anyInt())).thenReturn(this.authentication);
when(tgtMock.getChainedAuthentications()).thenReturn(authnListMock);
when(stMock.getGrantingTicket()).thenReturn(tgtMock);
final Service service2 = TestUtils.getService(SVC2_ID);
final ServiceTicket stMock2 = createMockServiceTicket(ST2_ID, service2);
final TicketGrantingTicket tgtMock2 = createMockTicketGrantingTicket(TGT2_ID, stMock2, false, tgtRootMock, authnListMock);
//Mock TicketRegistry
this.ticketRegMock = mock(TicketRegistry.class);
when(ticketRegMock.getTicket(eq(tgtMock.getId()), eq(TicketGrantingTicket.class))).thenReturn(tgtMock);
when(ticketRegMock.getTicket(eq(tgtMock2.getId()), eq(TicketGrantingTicket.class))).thenReturn(tgtMock2);
when(ticketRegMock.getTicket(eq(stMock.getId()), eq(ServiceTicket.class))).thenReturn(stMock);
when(ticketRegMock.getTicket(eq(stMock2.getId()), eq(ServiceTicket.class))).thenReturn(stMock2);
when(ticketRegMock.getTickets()).thenReturn(Arrays.asList(tgtMock, tgtMock2, stMock, stMock2));
//Mock ServicesManager
final RegisteredService mockRegSvc1 = createMockRegisteredService(service1.getId(), true, getServiceProxyPolicy(false));
final RegisteredService mockRegSvc2 = createMockRegisteredService("test", false, getServiceProxyPolicy(true));
final RegisteredService mockRegSvc3 = createMockRegisteredService(service2.getId(), true, getServiceProxyPolicy(true));
final ServicesManager smMock = mock(ServicesManager.class);
when(smMock.findServiceBy(argThat(new VerifyServiceByIdMatcher(service1.getId())))).thenReturn(mockRegSvc1);
when(smMock.findServiceBy(argThat(new VerifyServiceByIdMatcher("test")))).thenReturn(mockRegSvc2);
when(smMock.findServiceBy(argThat(new VerifyServiceByIdMatcher(service2.getId())))).thenReturn(mockRegSvc3);
final Map ticketIdGenForServiceMock = mock(Map.class);
when(ticketIdGenForServiceMock.containsKey(any())).thenReturn(true);
when(ticketIdGenForServiceMock.get(any())).thenReturn(new DefaultUniqueTicketIdGenerator());
this.cas = new CentralAuthenticationServiceImpl(ticketRegMock, null, mock(AuthenticationManager.class),
mock(UniqueTicketIdGenerator.class), ticketIdGenForServiceMock, mock(ExpirationPolicy.class),
mock(ExpirationPolicy.class), smMock, mock(LogoutManager.class));
}
开发者ID:hsj-xiaokang,项目名称:springboot-shiro-cas-mybatis,代码行数:59,代码来源:CentralAuthenticationServiceImplWithMockitoTests.java
示例15: setUp
import org.jasig.cas.util.DefaultUniqueTicketIdGenerator; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
this.handler = new Cas20ProxyHandler();
this.handler.setHttpClient(new SimpleHttpClient());
this.handler.setUniqueTicketIdGenerator(new DefaultUniqueTicketIdGenerator());
}