I want to create a GIS profile for my SAML log-in, but it's giving me an error. I check the password is correct, and so is the user name. When I run the script below using my ArcGIS Log in, it works just fine. Does anyone know how to create a profile with a SAML log in?
Here is the general script:
from arcgis.gis import GIS
from other import pw
gis_profile = GIS("https://subdomain.maps.arcgis.com", "user@name", pw, profile="ArcGISOnlinePJ")
print("Profile defined for {}".format(gis_profile))
Here is the error:
I don't think you can add a single user of a SAML directory. You would need to integrate your entire SAML directory with ArcGIS Online first. Afterwards, you could then utilize accounts in the SAML organization with ArcGIS Online.
We have integrated SAML logins for the whole company, but still keep ArcGIS logins. For whatever reason I'm not able to create a profile as of yet with my SAML account.
Login support for SAML accounts typically relies on an interactive login workflow that is not compatible with supplying your username and password directly to the GIS() method. Instead you need to use a different authentication scheme; ArcGIS supports the OAuth 2.0 standard.
Esri has a general example you can follow, User authentication with OAuth 2.0, which should enable you to leverage the single-sign-on method provided by your organization for SAML accounts.
While this approach is not compatible with GIS() profiles, having the url and client_id in the Python code is not as big of a security concern as having the password hardcoded there. So you don't need to use a profile.
Note that this approach only works for interactive logins. In general SAML accounts do not support non-interactive logins, so you cannot use this approach in, say, a scheduled Notebook.
Thank you, Peter. I should have mentioned my procedure runs multiple times an hour everyday so I need something non-interactive.
what is the hourly chore?
Incident data, @BillFox, do you have another idea?
is a live connection, join or append an option for your workflow?
I do so much data wrangling with pandas that a live connection to the database would not be idle. I basically run truncate and add on the feature layer.
if you did (live/join/append) could the wrangling be successfully done and automated on the other side of the fence?