|Applies To||RSA ClearTrust 5.5 Runtime C API|
|Issue||How to retrieve user map, map of user's properties, and specific named property from properties map in RSA ClearTrust 5.5 Runtime C API|
ct_map_find doesn't return user property
The functions ct_map_find and ct_map_get_str return NULL rather than the named property, but printing out the property map using ct_map_string shows the property to be present in the map
|Cause||User properties in the ct_map structure returned by ct_get_user_properties_pool are stored individually with char * keys, but with ct_item arrays for the map value, with the value of the property as a ct_str in the first slot of the array. Multi-valued properties are handled as a matter of course by returning an array with all the values for the property.|
|Resolution||The following code will retrieve a single valued property:|
ct_item * item = ct_map_get( user_properties_map, "[property name]", -1, CT_ITEM_ARRAY ) ;
if( item != NULL ) // item will be NULL if the property was not found in the map
printf( "[property name] = %s\n", item->cti_array->cti_str ) ;
Where [property name] is the name of the property you're trying to retrieve. For more details, see the documentation in the ct_item.h file.
NOTE: For any standard attribute to be exported as a user property, it must be listed in the argument to the parameter:
in the aserver.conf file.
|Legacy Article ID||a28638|