Skip to content

Added the ability to pull alternative ldap attributes for givenName, sn and c #321

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

Merged
merged 4 commits into from
Jan 13, 2018

Conversation

bhunut-adobe
Copy link
Collaborator

Customer requested that they want to use an alternative attribute for givenName and surname.

@adobeDan
Copy link
Contributor

@bhunut-adobe Please file an issue for this. Do you think the same enhancement is needed for the Okta connector?

Copy link
Contributor

@adobeDan adobeDan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change looks good, but please also update the docs (in English only) and be sure to file an issue.

@bhunut-adobe
Copy link
Collaborator Author

Ok, I will work on directory_okta also

@bhunut-adobe
Copy link
Collaborator Author

Dan,

I added the feature to okta connector and created issue #322

Copy link
Contributor

@adobeDan adobeDan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So the code looks very good (see the few comments in line). The overall question I have is a philosophical one: does it actually make sense, given that Okta has mandated directory values already for first name, last name, and email, to allow mapping those differently to Adobe than they are in Okta? It seems that any customization the customer would want to do of these fields should be done in the way they map their directory system to Okta rather than the way Okta's directory gets mapped to Adobe. So why don't you talk to @adorton-adobe and see what you guys think about whether we should allow customization for Okta.

# combining constant strings with the values of specific directory attributes.
# Any names in curly braces are taken as attribute names, and everything including
# the braces will be replaced on a per-user basis with the values of the attributes.
# The default value used here is simple, and suitable for OpenLDAP systems. If you
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems silly to talk about OpenLDAP systems versus AD systems in an Okta-specific connector configuration. Please consider whether Okta actually allows flexibility about each of these fields (because I suspect not for email, first name, and last name, which they have specific fields for in their directory system) and update the docs/impl accordingly.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

haha ok I will update it

# The default value used here is simple, and suitable for OpenLDAP systems.
# NOTE: for this and every format setting, the constant strings must be in
# the encoding specified by the string_encoding setting, above.
#user_country_code_format: "{countryCode}"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need a EOL at the end of this line.

source_attributes['id'] = user['uid'] = record.id
source_attributes['email'] = user['email'] = profile.email
source_attributes['email'] = email
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did you not just change profile.email to email on this line? (OK to leave it split; I was just wondering.)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh because I just copy the stuff from directory_ldap.

source_attributes[extended_attribute] = extended_attribute_value
else:
source_attributes[extended_attribute] = None
extended_attribute_value = OKTAValueFormatter.get_profile_value(record, extended_attribute)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice simplification.

@bhunut-adobe
Copy link
Collaborator Author

@adobeDan Let me know if the changes are good.

Copy link
Contributor

@adobeDan adobeDan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good updates.

@adobeDan
Copy link
Contributor

@bhunut-adobe @adorton-adobe Just wanted to confirm that you two had talked and agree we should allow customization of all of these fields so that they differ on the Adobe side than how they appear on the Okta side? Let me know and then I'll merge the fix.

@adorton-adobe
Copy link
Collaborator

I don't know if it makes sense to allow customization for Okta. Do we even have a way to test it in an Okta instance? I thought Okta didn't allow certain fields to be customized.

@adobeDan
Copy link
Contributor

@adorton-adobe We are not really customizing on the Okta side, we are allowing the Adobe side values to differ from the Okta side. I can't think of a case where that matters (because Okta never sees the values on the Adobe side and we ignore the values on the Okta side), but since the Okta fields have exactly the same semantics as the Adobe fields I just don't really see the customer need to make them different. So I can't tell if we're just doing this to be symmetric with LDAP and it would be simpler not to.

@adorton-adobe
Copy link
Collaborator

@adobeDan I assume that there would need to be configuration changes to populate first name, last name and country to non-standard fields. That is what I meant by customization - sorry for not being more clear.

I confirmed with Kevin that it is possible to do that. I don't know if it is something that customers are likely to do. I'd err on the side of adding the functionality as long as we test it sufficiently.

@adobeDan adobeDan merged commit 33b134d into adobe-apiplatform:v2 Jan 13, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants