-
Notifications
You must be signed in to change notification settings - Fork 141
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
get_user call returning different attribute name as part of result object #202
Comments
@klpradeepkl Thanks, for posting this issue. Your code looks fine. So, when you update |
Thanks for looking into the issue. That is correct. In Okta tenant, nickName is empty after execution of python script. It was empty before running the script. Result object is none. I am not sure why nick_name needs to be provided (while using python SDK) when in okta, standard attribute name is nickName. Regarding custom attribute issue, the scenario that i am facing is different. i have infact 2 custom attributes - "ssregion" & "isSSAliasUser" defined in okta. get_user call on the user id is returning, the attribute name as "ssregion" & "isSsAliasUser" (converted to camelcase) respectively. I already have values to these attributes in okta. When i try to do update_user on the new profile object as below, nothing gets updated in okta. code snippet: In Okta ( Before python script execution): In Okta ( After python script execution ----> No Change): |
Regarding basic attributes: we have casting to snake_case to make naming in "pythonic way". We will consider supporting both naming variants. So, if you provide "nick_name", it works for you? |
As of now both with nick_name and nickName(as in Okta tenant) both are not working. |
@klpradeepkl I've tested updating few fields with latest SDK version (including, nick_name) - it works for me. So, I have few questions:
2021-05-11 14:35:17,469 - okta-sdk-python - http_client - DEBUG - Request: {'method': 'PUT', 'headers': {'Accept': 'application/json', 'Content-Type': 'application/json', 'User-Agent': 'okta-sdk-python/1.6.0 python/3.8.2 Darwin/19.6.0', 'Authorization': 'SSWS <REDACTED>'}, 'url': 'https://<REDACTED>/api/v1/users/<REDACTED>', 'data': {'profile': {'displayName': 'Sergius', 'email': '<REDACTED>', 'firstName': 'Serhii', 'lastName': 'Buniak', 'login': '<REDACTED>', 'nickName': 'sergius', 'customAttr': 'Value for custom attribute', 'badgeNumber': 123}}} |
@klpradeepkl SDK v1.7.0 has been released, I'm closing this issue as resolved. Feel free to reopen this issue or create a new one if your issue still exists. |
I am having code as below, as in SDK documentation.
config = {
'orgUrl': 'https://dev-11111.okta.com',
'token': '<>'
}
okta_client = OktaClient(config)
user_info, resp, err = await okta_client.get_user("[email protected]")
new_profile = user_info.profile
new_profile.nick_name = 'Test'
updated_user_obj = models.User({'profile': new_profile})
updated_user, _, err = await okta_client.update_user("[email protected]", updated_user_obj)
In the above snippet, user_info object profile attribute has nick_name associated. But in okta, there is no such attribute in Okta. It is actuall nickName in okta. So, when i try to update nick_name in the code, nothing gets updated in okta and result object is none for update_user call.
May be i am missing something really basic ,but i am stuck. I have defined custom attribute(isSSAliasUser) in okta, again for that, get_user call is returning the variable name differently in camelCase notation(isSsAliasUser) . If i try to update the value for the custom attribute, result is none. Nothing gets updated in okta. Can you please direct what mistake is being done.
The text was updated successfully, but these errors were encountered: