How to check an exist user on Cloud Foundry using rest call on uaa

115 views
Skip to first unread message

Neihy Rincon

unread,
Mar 26, 2015, 10:53:35 AM3/26/15
to vcap...@cloudfoundry.org
Hello
In order to create a new user in Cloud Foundry we need to check first that this users doesn't exist.
We just have the email, so that's why we are using the uaac commands and we know that using  uaac user get bje...@example.com   is possible to find it, but we need to use a rest call.

We found this page: https://github.com/cloudfoundry/uaa/blob/master/docs/UAA-APIs.rst#query-for-information-get-users and in here exists the option to use either:

- GET /Users?attributes=userName&filter=userName eq 'bjensen'
- GET /Users?attributes=id&filter=emails.value eq 'bje...@example.com'

but at the end we our getting this issue : URI::InvalidURIError: bad URI(is not URI?)

Could you please  give us some advices about this? or Does somebody knows another way to use the rest-call to check the user using a rest call?
Thanks a lot in advance for any help
Cheers,

Neihy



Daniel Mikusa

unread,
Mar 26, 2015, 11:18:08 AM3/26/15
to vcap...@cloudfoundry.org
If you run the uaac command with the "-t" argument, it'll dump trace information, which includes the request and response data.  That should give an example of the REST API that it's using.

Also, make sure that you're properly url encoding your URL attributes like filter.

Dan

--
You received this message because you are subscribed to the Google Groups "Cloud Foundry Developers" group.
To view this discussion on the web visit https://groups.google.com/a/cloudfoundry.org/d/msgid/vcap-dev/55bc436b-130f-40ec-aa7a-ec35e574dcd8%40cloudfoundry.org.

To unsubscribe from this group and stop receiving emails from it, send an email to vcap-dev+u...@cloudfoundry.org.

Reply all
Reply to author
Forward
0 new messages