Skip to content

Commit

Permalink
allow for cas-server prefix setting for validation attempts
Browse files Browse the repository at this point in the history
  • Loading branch information
mmoayyed committed Aug 1, 2023
1 parent 2062c88 commit db74399
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 10 deletions.
1 change: 1 addition & 0 deletions .java-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
11.0
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Also, please do note that the Shibboleth IdP v3x+ has support for the CAS protoc
Software Requirements
-------------------------------------------------------------

This minimum supported version of Shibboleth Identity Provider is `4.1.0`.
This minimum supported version of Shibboleth Identity Provider is `4.3.0`.
See [releases](https://github.com/Unicon/shib-cas-authn/releases) to find the the appropriate version.


Expand Down
8 changes: 6 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ apply plugin: 'maven-publish'

defaultTasks 'clean', 'distZip', 'distTar'

sourceCompatibility = 1.11
targetCompatibility = 1.11
sourceCompatibility = 11
targetCompatibility = 11

group = 'net.unicon'
version = project.version
Expand Down Expand Up @@ -43,6 +43,10 @@ dependencies {
testImplementation "org.powermock:powermock-module-junit4:$project.powermockVersion"
}

test {
jvmArgs "--add-opens", "java.base/java.lang=ALL-UNNAMED"
}

distributions {
main {
distributionBaseName = 'shib-cas-authn'
Expand Down
6 changes: 3 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
version=4.3.0
version=4.3.1

casClientVersion=3.6.0
casClientVersion=3.6.4
commonLangVersion=3.11
junitVersion=4.13.1
mockitoVersion=3.6.28
powermockVersion=2.0.9
servletVersion=4.0.1
shibIdpVersion=4.3.0
shibIdpVersion=4.3.1
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public String getParameterString(final HttpServletRequest request, final boolean

String rpId = "error-encoding-rpid";

if (encode == true) {
if (encode) {
try {
rpId = URLEncoder.encode(relayingPartyId, "UTF-8");
} catch (final UnsupportedEncodingException e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ public class ShibcasAuthServlet extends HttpServlet {
private String casServerPrefix;
private String ticketValidatorName;
private String entityIdLocation;
private String casServerValidatorPrefix;

private AbstractCasProtocolUrlBasedTicketValidator ticketValidator;

Expand Down Expand Up @@ -166,13 +167,13 @@ public void init(final ServletConfig config) throws ServletException {

switch (ticketValidatorName) {
case "cas10":
ticketValidator = new Cas10TicketValidator(casServerPrefix);
ticketValidator = new Cas10TicketValidator(casServerValidatorPrefix);
break;
case "cas30":
ticketValidator = new Cas30ServiceTicketValidator(casServerPrefix);
ticketValidator = new Cas30ServiceTicketValidator(casServerValidatorPrefix);
break;
case "cas20":
ticketValidator = new Cas20ServiceTicketValidator(casServerPrefix);
ticketValidator = new Cas20ServiceTicketValidator(casServerValidatorPrefix);
}

if (ticketValidator == null) {
Expand All @@ -195,6 +196,7 @@ public void init(final ServletConfig config) throws ServletException {
*/
private void parseProperties(final Environment environment) {
logger.debug("reading properties from the idp.properties file");

casServerPrefix = environment.getRequiredProperty("shibcas.casServerUrlPrefix");
logger.debug("shibcas.casServerUrlPrefix: {}", casServerPrefix);

Expand All @@ -209,6 +211,9 @@ private void parseProperties(final Environment environment) {

entityIdLocation = environment.getProperty("shibcas.entityIdLocation", "append");
logger.debug("shibcas.entityIdLocation: {}", entityIdLocation);

casServerValidatorPrefix = StringUtils.defaultIfBlank(environment.getProperty("shibcas.casServerValidatorPrefix"), casServerPrefix);
logger.debug("shibcas.casServerValidatorPrefix: {}", casServerValidatorPrefix);
}

private void buildParameterBuilders(final ApplicationContext applicationContext) {
Expand Down

0 comments on commit db74399

Please sign in to comment.