
GopaK.04276 (Customer) asked a question.
Hi,
So lets say I have a string attribute user.foobar which might be empty (empty string or nil whatever denotes emptiness), and I don't want to send that in the id token unless it has a non-empty value. Is that even possible ? I couldnt see how it can be done (if it can be) from the EL docs, highly appreciated if anyone knows how to do it and can share it here
Rgds,
Gopa.

Hello
Thanks for posting.
To catch User attributes that are null or blank, use the following valid conditional expression:
user.employeeNumber != "" AND user.employeeNumber != null ? user.employeeNumber : user.nonEmployeeNumber
If a Profile attribute has never been populated, catch it with the following expression:
user.employeeNumber != null
If a Profile attribute was populated in the past but the content is removed, it's no longer
null
but an empty string. To catch these empty strings, use the following expression:
user.employeeNumber != ""
https://developer.okta.com/docs/reference/okta-expression-language/#samples-using-group-rules
Please also take a look at the following documents that might help you:
Okta Groups or Attribute Missing from Id Token
https://support.okta.com/help/s/article/Okta-Groups-or-Attribute-Missing-from-Id-Token?language=en_US
How to search for null and blank or deleted values in attributes via API?
https://support.okta.com/help/s/article/How-to-search-for-Null-and-Blank-or-Deleted-values-in-Attributes-via-API?language=en_US
How to pass multiple attribute values from Okta to app in the header
https://support.okta.com/help/s/article/OAG-How-to-pass-multiple-attribute-values-from-Okta-to-app-in-the-header?language=en_US
If you need further assistance, You can open a support case with our team using the information in the link below: https://help.okta.com/en/prod/Content/Topics/Directory/get-support.htm
Let us know if this helps you.
Daniela Chavarria.
Okta Inc.
Hi Daniela,
Unfortunately you missed the crux of my question "I don't want to send that in the id token unless it has a non-empty value". My requirement is that I don't want to include empty/null attributes in the id_token. I DONT want to send an attribute foobar with the value as null in the id-token, is that possible is the question.
Rgds,
Gopa.
Unfortunately you missed the crux of my question "I don't want to send that in the id token unless it has a non-empty value". My requirement is that I don't want to include empty/null attributes in the id_token. I DONT want to send an attribute foobar with the value as null in the id-token, is that possible is the question.
Rgds,
Gopa.