JSONDecodeError when using arcgis.gis.admin.EnterpriseUsers

339
5
Jump to solution
08-25-2021 01:23 PM
ChrisPy
New Contributor III

Hi guys,

Im running into a bit of an issue, same with others I saw so far already.

My goal is to use the module above to query our registered enterprise identity store for user details. I can successfully access the portal admin url shown below,

entUsers = admin.EnterpriseUsers(url="https://xxxxxxxxxxxxx/portal/portaladmin", gis=gis)

but when i try to do a get or search, i get the error,

JSONDecodeError: Expecting value: line 1 column 1 (char 0)

We are on Portal 10.8.1 and im using arcpro 2.6.4 python and jupyter notebook installs. 

0 Kudos
1 Solution

Accepted Solutions
ChrisPy
New Contributor III

resolved my issue. Basically i just needed to expose admin capabilities thru my existing GIS instance,

gis = GIS(url)

gisadmin = gis.admin

EU = gisadmin.security.enterpriseusers

Now I can search our AD via portals identity store.

View solution in original post

0 Kudos
5 Replies
MehdiPira1
Esri Contributor
0 Kudos
ChrisPy
New Contributor III

Thanks for these inputs.

Im basically trying to query our enterprise identity store which taps into our AD. I can successfully create the GIS instance, But when using the admin.EnterpriseUsers class, it seems to fail. Are you trying to say my issue is related to the way Im logging into Portal?

thanks also

0 Kudos
MehdiPira1
Esri Contributor

@ChrisPy 

When connecting using an enterprise user account from an Active Directory, specify your username as domain\\username.

You can use something like the following:

 

print("\n\nPortal-tier Authentication with LDAP - enterprise user")
gisldap = GIS("https://portalname.domain.com/webadapter_name", "AVWORLD\\Publisher", "password")
print("Logged in as: " + gisldap.properties.user.username)
# prints all the users from AD
gisldap.users.search()
# OR 
gisldap.users.search(query="@AVWORLD")

 

you also have the option to query:

gisldap.users.search(
    query=None,
    sort_field='username',
    sort_order='asc',
    max_users=100,
    outside_org=False,
    exclude_system=False,
    user_type=None,
    role=None,
)

I hope that helps.

======================================================================

Please give a like if helpful and Accept as Solution if it's answered your query.

 

0 Kudos
ChrisPy
New Contributor III

thanks again, but im not actually querying the registered portal users, what im after for is equivalent to this REST call,

https://xxxxxxxx/portal/portaladmin/security/users/searchEnterpriseUsers?max=1000&filter=xxx&f=json&...

This is what I believe the arcgis.gis.admin.EnterpriseUsers will allow me to do.

Cheers

0 Kudos
ChrisPy
New Contributor III

resolved my issue. Basically i just needed to expose admin capabilities thru my existing GIS instance,

gis = GIS(url)

gisadmin = gis.admin

EU = gisadmin.security.enterpriseusers

Now I can search our AD via portals identity store.

View solution in original post

0 Kudos