globus/globus-sdk-python

Use AuthClient.get_identities() to search by email address?

jasonsydes opened this issue · 2 comments

Hi Globus!

I am able to use AuthClient.get_identities() by passing it either "usernames=..." or "ids=...". That part works fine.

Is there a way to retrieve an identity using the user's email address? I've looked at the documentation for AuthClient.get_identities(), but it doesn't seem to support that? Entirely possible that I've overlooked something. Here's the docs I'm examining:

https://globus-sdk-python.readthedocs.io/en/latest/services/auth.html#globus_sdk.AuthClient.get_identities

In the web interface, searching for a user by their email address is apparently supported just fine...

Basically, sometimes our users enter their email addresses instead of their Globus username. I can combat that with more extensive documentation on our end, but it would be even better to be able to automate away the problem, by just retrieving their identity via their email address.

Thanks as always for your assistance!!!

I unfortunately have to close this as a wontfix. I'm sympathetic to this desire, but it's not possible at present for several reasons.

The first and most notable thing is that username and id are unique, per identity, but email address is not. For example, I may have sirosen@globus.org as my email address in multiple identity providers, providing distinct identities per provider. As a human, "obviously" an email address is unique, but there can be arbitrarily many identities with the same email address. So the operation you're asking for is not a "get X" but "search for X".

In the web interface, searching for a user by their email address is apparently supported just fine...

It is supported, and I'm glad that it's working for your use-cases! However, this feature is using a legacy part of the service which we know has some issues. We're beginning to push harder on internal efforts to have various Globus services publish information into Globus Search -- I'm hopeful that in the near term we may have an "identity search" feature which will satisfy this kind of need.

sometimes our users enter their email addresses instead of their Globus username. I can combat that with more extensive documentation on our end

I would say this is a common stumbling block for users, admins, and developers using Globus. It's exacerbated by the fact that a user's email address frequently does match their identity username, which leaves many users confused.

I'll look into what documentation we have which we can link, and perhaps we can recommend that you link a canonical doc about "email addresses vs usernames". If such a doc doesn't exist yet, I'll ask about authoring it.

Probably the fastest and least painful path for most users to get their true username is to login to app.globus.org and go to the account view (https://app.globus.org/account/identities). There, they can see their identities with fold-outs for more info like identity IDs:
image

Hi Stephen, no worries at all on this! Yes, I'm beginning to cobble together some documentation for our users that will address this. It's definitely a simple fix. And your reasons for not supporting such a feature are completely understandable. Thank you for getting back to me!!