-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Additional attributes not assigned to users created via SSO #4
Comments
Even the SAML request is providing correct attributes. The additional attributes for an IdP are not being mapped into Drupal fields
Notice the User entity has a textfield called first_name. |
The issue is with this part of the code:
When we save the data on the DB (I mean the custom fields) we serialize the data and save it, when we load the IDP we unserialize the data and we add it as a dynamic property on the SimpleSAML_Drupal object, in this case it seems the explode part is not creating the array the right way. Maybe because the properties are not been correctly defined or you're using a different operator. Can you debug the code and pass me the values you're using for those custom fields? |
"Maybe because the properties are not been correctly defined or you're using a different operator." You are right I was using the incorrect operator. The value in the Additional Attributes box was 'fisrt_name|first_name'. Once I changed it to 'first_name:first_name' this error dissapear. I think a validation in that form is needed. Although, even providing the correct operator the attributes are not being assigned to the users. This what $attributes looks like (after fixing the operator):
|
I think I got it, From simplesamlphp_auth.inc. We could substitute this
With this:
|
Ok, I think I solved the validation issue and the new issue we found with the value of the custom fields not working correctly when the same operator is used inside the value of the custom field. Take a look at this code and let me know what you think.
|
For the custom fields I think I have a good solution for it, instead of saving custom fields as properties of the Drupal SAML object I save them as a custom fields object array, like this:
And then we can access the properties like this:
Let me know what you think. |
This one makes totally sense, we already test it : ) Also using your solution for the attributes problem is way cleaner |
It makes perfect sense that fields from `Additional attributes` are populated automatically, instead of user having to hardcode how the fields are populated in source code of this module. This implementation has no support for translations or more complex fields. But it should work fine with basic fields that have simple value column. The implementation is inspired by comment by @pablo-tapia in AngelAlvarado#4.
It makes perfect sense that fields from `Additional attributes` are populated automatically, instead of user having to hardcode how the fields are populated in source code of this module. This implementation has no support for translations or more complex fields. But it should work fine with basic fields that have simple value column. The implementation is inspired by comment by @pablo-tapia in AngelAlvarado#4.
This is what I got in the error log:
Notice: Undefined offset: 1 in SimpleSAML_Drupal->load() (line 136 of includes/simplesamlphp_auth.drupal.inc). Notice: Undefined offset: 1 in SimpleSAML_Drupal->load() (line 136 of includes/simplesamlphp_auth.drupal.inc).
The text was updated successfully, but these errors were encountered: