forked from apereo/java-cas-client
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
allow extension points for JSON validation parsing. add filter and va…
…lidator
- Loading branch information
1 parent
4cb1eb4
commit c00627c
Showing
4 changed files
with
94 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
...n/java/org/jasig/cas/client/validation/Cas30JsonProxyReceivingTicketValidationFilter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/* | ||
* Licensed to Jasig under one or more contributor license | ||
* agreements. See the NOTICE file distributed with this work | ||
* for additional information regarding copyright ownership. | ||
* Jasig licenses this file to you under the Apache License, | ||
* Version 2.0 (the "License"); you may not use this file | ||
* except in compliance with the License. You may obtain a | ||
* copy of the License at the following location: | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
package org.jasig.cas.client.validation; | ||
|
||
/** | ||
* Creates either a Cas30JsonServiceTicketValidator to validate tickets. | ||
* | ||
* @author Misagh Moayyed | ||
*/ | ||
public class Cas30JsonProxyReceivingTicketValidationFilter extends Cas30ProxyReceivingTicketValidationFilter { | ||
|
||
public Cas30JsonProxyReceivingTicketValidationFilter() { | ||
super(); | ||
this.defaultServiceTicketValidatorClass = Cas30JsonServiceTicketValidator.class; | ||
this.defaultProxyTicketValidatorClass = Cas30JsonServiceTicketValidator.class; | ||
} | ||
} |
41 changes: 41 additions & 0 deletions
41
...t-core/src/main/java/org/jasig/cas/client/validation/Cas30JsonServiceTicketValidator.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package org.jasig.cas.client.validation; | ||
|
||
import java.util.List; | ||
import java.util.Map; | ||
|
||
/** | ||
* This is {@link Cas30JsonServiceTicketValidator}. | ||
* | ||
* @author Misagh Moayyed | ||
*/ | ||
public class Cas30JsonServiceTicketValidator extends Cas30ProxyTicketValidator { | ||
public Cas30JsonServiceTicketValidator(final String casServerUrlPrefix) { | ||
super(casServerUrlPrefix); | ||
getCustomParameters().put("format", "JSON"); | ||
} | ||
|
||
@Override | ||
protected List<String> parseProxiesFromResponse(final String response) { | ||
return super.parseProxiesFromResponse(response); | ||
} | ||
|
||
@Override | ||
protected String parseProxyGrantingTicketFromResponse(final String response) { | ||
return super.parseProxyGrantingTicketFromResponse(response); | ||
} | ||
|
||
@Override | ||
protected String parsePrincipalFromResponse(final String response) { | ||
return super.parsePrincipalFromResponse(response); | ||
} | ||
|
||
@Override | ||
protected String parseAuthenticationFailureFromResponse(final String response) { | ||
return super.parseAuthenticationFailureFromResponse(response); | ||
} | ||
|
||
@Override | ||
protected Map<String, Object> extractCustomAttributes(final String xml) { | ||
return super.extractCustomAttributes(xml); | ||
} | ||
} |