use of org.apereo.cas.authentication.principal.WebApplicationServiceFactory in project cas by apereo.
the class WebUtilTests method verifyFindService.
@Test
public void verifyFindService() {
final DefaultArgumentExtractor casArgumentExtractor = new DefaultArgumentExtractor(new WebApplicationServiceFactory());
final MockHttpServletRequest request = new MockHttpServletRequest();
request.setParameter(CasProtocolConstants.PARAMETER_SERVICE, "test");
final Service service = WebUtils.getService(Arrays.asList(casArgumentExtractor), request);
assertNotNull(service);
assertEquals("test", service.getId());
}
use of org.apereo.cas.authentication.principal.WebApplicationServiceFactory in project cas by apereo.
the class ManageRegisteredServicesMultiActionControllerTests method setUp.
@Before
public void setUp() throws Exception {
this.servicesManager = new DefaultServicesManager(new InMemoryServiceRegistry());
this.registeredServiceFactory = new DefaultRegisteredServiceFactory(new DefaultAccessStrategyMapper(), policyMapper, new DefaultProxyPolicyMapper(), new DefaultRegisteredServiceMapper(), new DefaultUsernameAttributeProviderMapper(), Collections.emptyList());
this.controller = new ManageRegisteredServicesMultiActionController(this.servicesManager, this.registeredServiceFactory, new WebApplicationServiceFactory(), "https://cas.example.org");
}
use of org.apereo.cas.authentication.principal.WebApplicationServiceFactory in project cas by apereo.
the class OAuth20AccessTokenControllerTests method addRefreshToken.
private RefreshToken addRefreshToken(final Principal principal, final RegisteredService registeredService) {
final Authentication authentication = getAuthentication(principal);
final WebApplicationServiceFactory factory = new WebApplicationServiceFactory();
final Service service = factory.createService(registeredService.getServiceId());
final RefreshToken refreshToken = oAuthRefreshTokenFactory.create(service, authentication);
oAuth20AccessTokenController.getTicketRegistry().addTicket(refreshToken);
return refreshToken;
}
use of org.apereo.cas.authentication.principal.WebApplicationServiceFactory in project cas by apereo.
the class RegisteredServiceTestUtils method getService.
public static AbstractWebApplicationService getService(final String name) {
final MockHttpServletRequest request = new MockHttpServletRequest();
request.addParameter("service", name);
return (AbstractWebApplicationService) new WebApplicationServiceFactory().createService(request);
}
use of org.apereo.cas.authentication.principal.WebApplicationServiceFactory in project cas by apereo.
the class SamlRegisteredServiceTests method checkPattern.
@Test
public void checkPattern() {
final SamlRegisteredService service = new SamlRegisteredService();
service.setName(SAML_SERVICE);
service.setServiceId("^http://.+");
service.setMetadataLocation(METADATA_LOCATION);
final InMemoryServiceRegistry dao = new InMemoryServiceRegistry();
dao.setRegisteredServices(Collections.singletonList(service));
final DefaultServicesManager impl = new DefaultServicesManager(dao);
impl.load();
final RegisteredService s = impl.findServiceBy(new WebApplicationServiceFactory().createService("http://mmoayyed.unicon.net:8081/sp/saml/SSO"));
assertNotNull(s);
}
Aggregations