Skip To Content

Access the ArcGIS platform

In this topic

The ArcGIS platform provides a full range of GIS capabilities. There are various ways to add powerful functionality and intelligence to your ArcGIS Runtime app by connecting to platform capabilities.

ArcGIS Online

ArcGIS Online is a cloud-based, collaborative content management system for maps, apps, data, and other geographic content. You can access ArcGIS Online through mobile devices, a website (www.ArcGIS.com), and desktop map viewers. With ArcGIS Online you can do the following:

  • Create web maps.
  • Web enable your data.
  • Share your maps, data, and applications.
  • Find relevant and useful basemaps, data, and configurable GIS resources.
  • Manage content and users in your organization.

Tip:

With your free ArcGIS for Developers account, you have access to ArcGIS Online for development and testing. Sign in at developers.arcgis.com or www.ArcGIS.com.

Using ArcGIS Runtime, you can access and edit existing content and create new content items, comment and add ratings, search for users and groups, and share and unshare items.

Learn more about developing with ArcGIS Online in ArcGIS Online Help.

ArcGIS for organizations

To access all the capabilities of ArcGIS Online, your organization can purchase a subscription. With this subscription, you can store and process geographic data, solve complex routing problems, perform spatial analysis, create reports, and enrich your own data with demographic and geographic attributes. You also gain access to various productivity apps. A subscription can help you make geospatial information more pervasive, both within your organization and throughout the general public.

Tip:

Your free ArcGIS for Developers account includes some subscription-only services for development and testing. Sign in at developers.arcgis.com or www.ArcGIS.com. If you upgrade your free account to a paid plan, you can still sign in using both of these sites.

Learn more about ArcGIS for organizations on esri.com.

Portals, users, roles, groups, and sharing

ArcGIS Online is an information portal and is represented in the API by the ArcGISPortal class.

When you sign in to ArcGIS Online with an organization account, you see a specialized view that your organization administrator has configured for you, giving you access to maps, content, and other services specific to your organization. You can also access all your own content and services.

A registered user of a portal is represented in the API by the ArcGISPortalUser class. When you have signed in to a portal, you can get information relating to the authenticated user from the portal class. There are different ways to sign in to a portal—see the Authentication documentation online.

Portals and users have an essential role to play in some app licensing scenarios. For more information about licensing, see License your app.

Groups are a way to collaborate with other users who share a common interest. A user can create groups, join groups, and share items with those groups. Groups have titles, descriptions, thumbnails, and unique IDs to help users identify them. The sharing model within ArcGIS Online is based on groups. Groups are represented in the API by the ArcGISPortalGroupclass.

A free, public account is another way to access ArcGIS Online. These accounts are not associated with an organization and offer a limited set of functionality. A public account allows you to use and create maps and share your maps and apps with everyone. Public accounts are for noncommercial use only.

Connect to public content and services on ArcGIS Online

To connect to ArcGIS Online and access public content anonymously, you can begin by creating a portal, without passing in any user credentials:

// call the static method CreateAsync without arguments to get a reference to the arcgis.com portal
ArcGISPortal portal = await ArcGISPortal.CreateAsync();

// get portal info and display it to the user
ArcGISPortalInfo portalInfo = portal.ArcGISPortalInfo;

propertiesListBox.Items.Add(string.Format("Current Version: {0}", portal.CurrentVersion));
propertiesListBox.Items.Add(string.Format("Access: {0}", portalInfo.Access));
propertiesListBox.Items.Add(string.Format("Host Name: {0}", portalInfo.PortalHostname));
propertiesListBox.Items.Add(string.Format("Name: {0}", portalInfo.PortalName));
propertiesListBox.Items.Add(string.Format("Mode: {0}", portalInfo.PortalMode));

From here, you can access public content; for example, you can display a web map, or download the data stored in a portal item. You can also Search portal content such as web maps, map services, map features, groups, and users.

Some organizations share content publicly and allow anonymous access to that content; connect to publicly accessible content from such organizations by specifying the organization URL, for example:

// call the static method CreateAsync with a Uri argument to get a reference to a specific portal
ArcGISPortal portal = await ArcGISPortal.CreateAsync(new Uri("http://anorganization.maps.arcgis.com"));

Connect to secured content and services on ArcGIS Online

Apps that target organization users who are known to the ArcGIS platform (a named user) should pass credentials for the user when creating the portal object.

// use the IdentityManager to authenticate a user for a portal
try
{
    // exception will be thrown here for bad credential ...
    var cred = await Esri.ArcGISRuntime.Security.IdentityManager.Current.GenerateCredentialAsync(
        "http://anorganization.maps.arcgis.com", UserTextBox.Text, PasswordTextBox.Password);

    // add credential if generation was successful
    Esri.ArcGISRuntime.Security.IdentityManager.Current.AddCredential(cred);
}
catch(ArcGISWebException webExp)
{
    // ... handle exception for bad credential here ...
}

// connect to the server (IdentityManager automatically includes the credential if available)
_portal = await Esri.ArcGISRuntime.Portal.ArcGISPortal.CreateAsync(new Uri("http://anorganization.maps.arcgis.com"));
ArcGISPortalUser user = _portal.CurrentUser;
var userName = user.FullName;
var orgName = _portal.ArcGISPortalInfo.Name;

The portal object now has access to all the secure content for which the user has access rights and can find out more information about the user, such as the full name (instead of the account user name). Additionally, information about the organization such as the name, banner image, description, and so on, can be found as shown above. Apps often make use of this information when a user connects to a specific portal, to show the user organization branding and context.

Typically, the portal object with the authenticated user is cached and used throughout the app session, to provide the app with a view of a portal that is centered around a single user. When the app is restarted, the credentials must be reinstated, or the user must repeat the authentication process.

To access secure content, an app needs to provide a way to sign in to the platform, a process often known as authentication. The recommended approach for authenticating a user known to the platform is to use a user login and OAuth. Apps that target users who are unknown to the ArcGIS platform can authenticate with the platform on behalf of the user by using an app login.

The portal class contains methods to authenticate using OAuth 2.0 for both user and app logins. Again, the authenticated portal object can be cached and reused throughout the app session.

Portal for ArcGIS

Portal for ArcGIS provides you with the same core capabilities as ArcGIS Online, but it can be installed and hosted on your own premises, behind your firewall, for controlled distribution of content.

Learn more about Portal for ArcGIS on esri.com.

Connect to Portal for ArcGIS

Connecting to an instance of Portal for ArcGIS is done in a very similar way to connecting to ArcGIS Online and is represented in the API by the same class, ArcGISPortal. Use the URL to the Portal for ArcGIS website, along with appropriate credentials valid on that portal, or no credentials if accessing public content anonymously.

// use the IdentityManager to authenticate a user for a portal
try
{
    // exception will be thrown here for bad credential ...
    var cred = await Esri.ArcGISRuntime.Security.IdentityManager.Current.GenerateCredentialAsync(
        "http://geoportal.mycompany.com", UserTextBox.Text, PasswordTextBox.Password);

    // add credential if generation was successful
    Esri.ArcGISRuntime.Security.IdentityManager.Current.AddCredential(cred);
}
catch(ArcGISWebException webExp)
{
    // ... ignore exception for bad credential, try to connect anonymously (access public content) ...
}

// connect to the server (IdentityManager automatically includes the credential if available)
_portal = await Esri.ArcGISRuntime.Portal.ArcGISPortal.CreateAsync(new Uri("http://geoportal.mycompany.com"));
ArcGISPortalUser user = _portal.CurrentUser;
var userName = user.FullName;
var orgName = _portal.ArcGISPortalInfo.Name;

ArcGIS for Server

ArcGIS for Server is a complete and integrated server-based GIS, allowing you to publish many different types of GIS services for use by a variety of clients including ArcGIS Runtime apps. Some services provide similar functionality to that available from ArcGIS Online—for example, you can create map layers based on map, feature, or WMS services, and perform geocoding, routing, or geoprocessing functions by using services hosted by ArcGIS for Server.

Discover content and services on ArcGIS for Server

Use the ArcGIS Services Directory to browse the available services on an ArcGIS for Server site. Open the REST Services home page in a browser, for example, http://sampleserver6.arcgisonline.com/arcgis/rest/services.

Contact your ArcGIS Server system administrator if you're uncertain about the server URL or ArcGIS instance.

Connect to ArcGIS for Server

Connecting to ArcGIS for Server is a little different from connecting to portals—instead of connecting to the portal itself, you pass the URL of the service you want to use to a class designed to work with that service type.

For example, you can create a map layer by passing in the URL to a dynamic map service:

var uri = new Uri("http://sampleserver6.arcgisonline.com/arcgis/rest/services/DamageAssessment/MapServer");
ArcGISDynamicMapServiceLayer dynamicLayer = new ArcGISDynamicMapServiceLayer(uri);

ArcGIS for Server services are listed below, along with the classes that make use of them.

Service typeAPI classes

Feature service

FeatureLayer, FeatureTable

Feature service—Query endpoint

QueryTask

Feature service—Create replica, synchronize replica, unregister replica, and apply edits endpoints

GeodatabaseSyncTask

Map service—Dynamic

ArcGISDynamicMapServiceLayer

Map service—Tiled

ArcGISTiledMapServiceLayer

Map service—WMS endpoint

WMSLayer

Map service—WMTS endpoint

WMTSLayer

Map service—Identify endpoint

IdentifyTask

Map service—Export tiles endpoint

ExportTileCacheTask

GeocodeServer

LocatorTask

GPServer

Geoprocessor

NAServer

RouteTask

ArcGIS for Server services and related API classes

Learn more about ArcGIS for Server on esri.com.

Related topics