This article is part of a series I'm writing over the next few weeks to lay down the foundations of the language with concrete examples that you can execute in PingFederate. I'll be using the OGNL Language Guide on apache.com as a template for these topics, making them relevant to PingFederate.
You'll find the complete list of articles in my OGNL series at the end of this entry.
I will assume that you are familiar with coding in general and the Java language in particular, although you do not need to be an expert. Each example will be explained. I will provide code examples you can use to solve specific problems in PingFederate. Sometimes these code examples will just show the concept being discussed, but you can be sure that all the code examples provided will work in PingFederate. The Language Guide is a good starting point for some of the basics. Some things (for example, Constants) will not be covered in this series because the Guide does a good job. We will just use them as needed.
One question you may have is, 'why do I need to use OGNL?' Here are some possible reasons:
- You only need to send a subset of the data in the attribute, for example you have a code value that contains department and division codes as one value but you only need the department code to be sent
- You need to reformat the data, for example take a date that is MM/DD/YYYY and make it YYYY-MM-DD
- The attribute value you have is not exactly what you need and it needs to be tweaked
The first step is to enable OGNL support in PingFederate. Refer to Enabling and disabling expressions in the PingFederate documentation for information about turning on OGNL support in your PingFederate server.
In the next issue in the series we will start with a simple OGNL example and learn how to fetch attributes in PingFederate. I hope that you find this series helpful, and I would be glad to hear from you on how this can be improved, or what additional topics on OGNL you would like to see.
****************************************
OGNL Blog Series:
- Introduction to OGNL
- A simple OGNL expression
- Declaring variables in OGNL
- Method calls in OGNL
- Arrays in OGNL
- OGNL: What about those curly braces?
- Looping in OGNL
- Looping in OGNL take 2
- So what exactly is #this in OGNL?
- A continuing look at #this variable in OGNL
- Functions in OGNL
- Misc Topics in OGNL
John DaSilva develops training and solutions at Ping Identity.