Introduction to OGNL
OGNL (or, if you spell it out, Object-Graph Navigation Language) can be a challenge the first time you use it to solve a problem. OGNL can be used in PingFederate to accomplish mapping requirements that don't fit into a straight copy of one attribute value into another attribute. The biggest challenge is just getting through the basics of the language. Although OGNL looks and feels like Java, it's just different enough to make it a frustrating experience.
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:
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:
John DaSilva develops training and solutions at Ping Identity.
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.
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:
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.
John DaSilva develops training and solutions at Ping Identity.