Select to view content in your preferred language

AGOL default Organization URL

273
2
01-26-2026 09:56 AM
MKa
by
Frequent Contributor

I am moving all of our organizations federatedfeature services to AGOL and now I am trying to prompt the user to login to ArcGIS.com, but want to default in our organization's URL to the login popup that appears when my code runs this

MyPortal = ArcGISPortalManager.Current.GetPortal(new Uri("https://www.arcgis.com"));

if (!MyPortal.IsSignedOn())
{
SignInResult signInResult = MyPortal.SignIn();
}

This code prompts the user for the organizational URL https://myURL.maps.arcgis.com, but i want to default it in there.  If I change the GetPortal to my organizational URL https://myURL.maps.arcgis.com but it doesn't work like i need it to.  It does log me in, but the maps don't seem to be able to connection to my federated services like when i connect to AGOL and enter my Org URL.  Plus, i don't want to entries in my ArcGIS Pro portal list.

Is there a way to enter this in my code.

 

 

 

0 Kudos
2 Replies
GKmieliauskas
Esri Regular Contributor

Hi,

I think you use invalid url to connect to your portal. Your url must look like: 

"<url.Scheme>://<url.Host>/portal/"

 Try at first with Esri Community sample PortalInfoListAllFedServers

0 Kudos
MKa
by
Frequent Contributor

I know how to connect to a portal and AGOL.  I just want to populate the ArcGIS.com organizational URL with "MyCompany".  I have tried all of the registry tricks, changing AuthPortal, changing json files.  I just cant get this prepopulated.  If I can get this prepopulated I don't have to add my org portal directly and switch between them.  I need to keep ArcGIS.com active as my MyCompany.maps.arcgis.com uses ArcGIS.com for Token auth i am guessing.  So we have to log into both regardless.  I just want to prepopulate this for my users on first load or ArcGIS Pro install of my addin.  I am wondering what I am missing here, I have tried to solve this with AI and updating Registry and Files.  Just wondering if someone could clear out their portal list except for ArcGIS.com, sign out of all of them, load ArcGIS Pro and have that box prepopulated with a value.  I don't want to add a seperate portal to the list, ArcGIS.com entry will do everything I want once I put in the Org URL and sign in.  As it handles all requests and Authentication.

 

MKa_0-1769529883984.png

 

0 Kudos