03-14-2017 09:49 AM - edited 03-01-2019 06:24 AM
Hello,
I have integrated UCSD with company's AD, where users are composed of <username>@<domain>. Also, I have some external scrips to manage user-to-group assignments with API. I call some functions for reading user data, and updating user data (/cloupia/api-v2/user), and they work properly if the username is simply a-z, 1-9 characters. However, an empty result is returned every time I work with logins like 'username@domain'. I tried to send the login as is, and using urlencoded format (%40 instad of @). The result is the same. Any ideas how I can make it work?
Cheers,
Krzysztof
03-14-2017 09:52 AM
Have you tried “A@B” or ‘A@b’ ?
Orf Gelbrich
Check out UCS Director Workflow INDEX<https://communities.cisco.com/docs/DOC-56419> on Cisco Communities Site (Twitter @UCSDGURU)
03-14-2017 10:32 AM
I tried with no quotations and with 'A@B', the result is always the same. Also, when I use REST API Browser in UCSD, it also returns empty content.
03-15-2017 12:40 AM
OK, I did some more tests, and it seems the issue is with '.' (dot) in username or domain. When the username is <a-z> or <a-z>@<a-z> it works fine. But if the username is <a-z>.<a-z> or <a-z>@<a-z>.<a-z> the empty result is returned. So, looks like API call does not recognize properly a dot in username, which is really bad. There are many users with a dot, let alone having domain name with a dot inside. I have over 100 users for which I have to change the group, and API is perfect tool for that, but it doesn't work :-(
03-15-2017 07:21 AM
What version of UCSD are you using?
03-15-2017 09:36 AM
I used 6.0.0.0 build 60299, but I have just patched it to the most recent version 6.0.1.1 build 60440, and the result is the same.
03-15-2017 10:43 AM
I looked into logfile, and foud something like this:
2017-03-15 17:28:52,585 [ORP-1-44] ERROR run(OperationRequestProcessor.java:130) - Exception occured while executing request
java.lang.Exception: unable to build context for user.Test.User. No child node found for User
This log is created when I do calls for Test.User username. It seems that the whole API engine is poorly written, someone assumed that username will not have a dot in the name. This is sad.
03-15-2017 01:30 PM
As a workaround can you pull all the users back and look for the user id in question...
The create and update user APIs do work. I create the russ@domain.com with the user create API.
03-15-2017 01:42 PM
I created a bug ticket for you. CSCvd59213
03-16-2017 06:52 AM
Thanks.
03-16-2017 06:52 AM
Yes, if you create a user, and all data is within XML tags, eferything works fine. The issue seems to be with the update URL, where you have to specify the user, ie. /cloupia/api-v2/user/User.Name
03-16-2017 08:48 AM
Yes it chokes on the dot.
Orf Gelbrich
Check out UCS Director Workflow INDEX<https://communities.cisco.com/docs/DOC-56419> on Cisco Communities Site (Twitter @UCSDGURU)
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide