This service is intended for colleges that would like to be able to retrieve the CCCIDs being associated with EPPNs that are routed through the CCC IDP Proxy. Every student that accesses a service through the IDP Proxy must have a CCCID. If the college IDP cannot provide the CCCID, then the IDP Proxy will attempt to map the colleges EPPN to the CCCID. This service provides a way for colleges to read those mappings so that they may potentially be imported back into the colleges SIS.
Colleges wishing to use this service will need to contact the TechCenter so that a client Id and secret can be generated. The client Id and secret will be used to authenticate requests to this service. College will need to provide the EPPN domain when requesting credentials.
A Java client library is available. The client allows property file configuration of endpoints and authentication. The Java client library will handle lookup up the OpenId token, setting the Authorization header, hitting the REST endpoint and converting data into Java objects. To import the library include the following segment in your pom file:
Code Block |
---|
language | xml |
---|
linenumbers | true |
---|
|
<properties>
<commons-cli.version>1.3.1</commons-cli.version>
<!-- todo: need to create a release version -->
<ccc.common-identity.version>1.1.0-SNAPSHOT</ccc.common-identity.version>
<eppn-service.version>1.1-SNAPSHOT</eppn-service>
</properties>
<repositories>
<repository>
<id>nexus-releases</id>
<name>CCC Nexus Repo - Release</name>
<url>https://nexus.dev.ccctechcenter.org/content/repositories/releases</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
<repository>
<id>nexus-snapshots</id>
<name>CCC Nexus Repo - Snapshots</name>
<url>https://nexus.dev.ccctechcenter.org/content/repositories/snapshots</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>net.cccnext.services</groupId>
<artifactId>eppn-service-client</artifactId>
<version>${eppn-service.version}</version>
</dependency>
<dependency>
<groupId>net.cccnext</groupId>
<artifactId>common-identity</artifactId>
<version>${ccc.common-identity.version}</version>
</dependency>
</dependencies> |
To configure the EPPN Service for a spring boot application:
Code Block |
---|
language | java |
---|
linenumbers | true |
---|
|
@Configuration
@PropertySources({
@PropertySource("classpath:defaults.properties"),
@PropertySource(value = "file:overrides.properties", ignoreResourceNotFound = true),
})
@EnableConfigurationProperties
public class Config {
@Autowired
EppnServerSettings serverSettings;
/**
* Configure the EPPN service object. EPPN service object provides the following methods:
*
* Eppn getEppnMapping(String eppn);
* Page<Eppn> getNewMappings();
* Page<Eppn> getNewMappings(int page, int pageSize);
* Page<Eppn> getMappingsSince(Date d);
*
* List<BatchStatus<String>> markAsDownloaded(String... eppn);
* List<BatchStatus<String>> markAsDownloaded(List<Eppn> eppnList);
*/
@Bean
public IEppnService getEppnService() throws NoSuchAlgorithmException, KeyStoreException, KeyManagementException {
EppnV2Service svc = new EppnV2Service();
svc.setRestOperations(getRestTemplate());
svc.setServerSettings(serverSettings);
return svc;
}
@Bean
public RestOperations getRestTemplate() throws KeyStoreException, NoSuchAlgorithmException, KeyManagementException {
ServiceAccountManager manager = getServiceAccountManager();
CCCRestTemplate template = new CCCRestTemplate();
template.setJwtGetter(manager);
return template;
}
@Bean
public ServiceAccountManager getServiceAccountManager() {
return new ServiceAccountManager(serverSettings.getBaseTokenUrl(), serverSettings.getClientId(), serverSettings.getClientSecret());
}
@Bean
public static PropertySourcesPlaceholderConfigurer propertyConfig() {
return new PropertySourcesPlaceholderConfigurer();
}
} |
Config file:
Code Block |
---|
eppn-service.server=eppn.cccmypath.org
eppn-service.contextPath=/eppn
eppn-service.secure=true
eppn-service.allowInsecureHttps=false
eppn-service.baseTokenUrl=https://login.cccmypath.org/f
eppn-service.clientId=NEEDS_OVERRIDE
eppn-service.clientSecret=NEEDS_OVERRIDE |