Created
October 30, 2019 19:22
-
-
Save harrdou/1d366a23a50c33f5b401def8eef223b8 to your computer and use it in GitHub Desktop.
CATSv2IDPAttributeMapper from the CATS IDP Simulator
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
package ca.gc.ssc.cats; | |
import com.sun.identity.saml2.plugins.DefaultIDPAttributeMapper; | |
import com.sun.identity.saml2.common.SAML2Exception; | |
import java.util.List; | |
/** | |
* This class <code>CATSv2IDPAttributeMapper</code> implements the | |
* <code>IDPAttributeMapper</code> to return the only SAML Attribute | |
* mandated by CATS v2 for insertion in the SAML Assertion. | |
*/ | |
public class CATSv2IDPAttributeMapper extends DefaultIDPAttributeMapper | |
{ | |
/** | |
* Constructor | |
*/ | |
public CATSv2IDPAttributeMapper() { | |
super(); | |
} | |
public List getAttributes(Object session, String hostEntityID, | |
String remoteEntityID, String realm) throws SAML2Exception | |
{ | |
List attributes = new java.util.ArrayList(); | |
String[] values = {"2.0"}; // CATS Version | |
attributes.add(getSAMLAttribute("ca:gc:cyber-authentication:basic:specVer", | |
"urn:oasis:names:tc:SAML:2.0:attrname-format:uri", | |
values, hostEntityID, remoteEntityID, realm) ); | |
return attributes; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment