Attribute serialization is the process by which attribute names and values are encoded onto the HTTP response. PingFederate performs serialization of attributes at the pick up endpoint and also at the drop off endpoint to encode the reference name and value. How attributes are serialized impacts the way in which your application parses them off of the HTTP response.
The AttributeSerializer class used by the adapter instance is configured in the adapter GUI configuration screen (in advanced settings) of PingFederate's administrative console. The default implementation is com.pingidentity.pf.adapters.backref.PropertiesSerializer which leverages the built in capabilities of the Java Properties class. You may have noticed in the code example that a Properties object is used to parse the response. This is very convenient if your application is written in Java but may not be the best option for other platforms (the Properties class has some esoteric rules for escaping certain characters). Another option is provided, com.pingidentity.pf.adapters.backref.SimpleSerializer, which simply encodes each attribute, one per line, as [name]=[value]. No escaping or additional encoding is performed.
If neither of the provided implementations meet your needs, you may choose to write your own AttributeSerializer implementation. To do so, include the adapter jar file on the compile class path and implement the interface shown below. Then make your implementation available to PingFederate's class path (the easiest way to do this is to jar up the class and place the jar file in the server/default/lib directory of PingFederate). Finally, provide the fully qualified class name of your implementation for the "Attribute Serializer" field under advanced settings when configuring the adapter in the GUI.
package com.pingidentity.pf.adapters.backref; public interface AttributeSerializer { void serialize(Map<String, AttributeValue> attributes, HttpServletRequest req, HttpServletResponse resp) throws IOException; }
Attribute deserialization is the process by which attribute names and values are decoded from the HTTP request. PingFederate performs deserialization at the drop off endpoint. How attributes are deserialized impacts the way in which your application encodes them onto the HTTP request.
The AttributeDeserializer class used by the adapter instance uses is configured in the adapter GUI configuration screen (in advanced settings) of PingFederate's administrative console. The default implementation is com.pingidentity.pf.adapters.backref.SimpleDeserializer which parses attribute names and values from the request parameters of the query string (don't forget URL encoding).
If the provided implementation does not meet your needs, you may choose to write your own AttributeDeserializer implementation. To do so, include the adapter jar file on the compile class path and implement the interface shown below. Then make your implementation available to PingFederate's class path (the easiest way to do this is to jar up the class and place the jar file in the server/default/lib directory of PingFederate). Finally, provide the fully qualified class name of your implementation for the "Attribute Deserializer" field under advanced settings when configuring the adapter in the GUI.
package com.pingidentity.pf.adapters.backref; public interface AttributeDeserializer { Map<String, AttributeValue> deserialize(HttpServletRequest req, HttpServletResponse resp) throws IOException; }