A portal is a website with tools that can be used to create, manage, access, and share geospatial content and data. It supports many different types of content such as web maps, web scenes, hosted layers, data services, and files. A portal also provides tools to create maps, scenes, and layers, import data, create data services, and manage users and groups in the organization.
In addition, a portal includes security and authentication capabilities, comprised of access controls for that portal's content, as well as authentication services for apps and users to gain access to a portal's secured content and tools.
As a developer, you can use a portal to manage developer credentials and create content and data services for your applications.
ArcGIS Location Platform, ArcGIS Online, and ArcGIS Enterprise all include portals which a developer can use to authenticate their apps and users, create or manage content, and control access to that content. For ArcGIS Location Platform and ArcGIS Online, the portal is hosted in Esri's infrastructure. For ArcGIS Enterprise, the portal is installed and hosted on infrastructure you control, either in the cloud or on-premises.
Learn more about working with portals in the Introduction to portals guide. See How to use authentication in the developer guide to learn more about creating and managing developer credentials.
Items, users, and groups in a portal
An ArcGIS portal is represented in the ArcGIS Maps SDK for Swift by the Portal
class. This class is loadable. Other classes in this API represent the items, users, and groups in a portal.
Portal items
An ArcGIS portal can store many types of content. See Supported items in the ArcGIS documentation for an exhaustive list. Perhaps the type most commonly used by apps is a web map—a JSON description of the data in a map, along with other display and behavioral properties. Other types include tile packages, feature collections, and services. Some types, such as globe documents and map templates, may only be relevant to desktop systems. Although you can access these types of data, you may not be able to use them on a mobile device.
The PortalItem
class represents an individual item stored on a portal. Each item includes the following:
- Metadata, such as a unique identifier (ID), title, summary, description, thumbnail image, and tags
- Binary or text-based data—for example, the JSON that defines a web map or a feature collection, or a URL pointing to a map service, or the binary data of a tile package or shapefile.
The item ID is the most important metadata for a portal item. You can use the ID to access an item in the portal and work with it in your app (such as loading a web map from a portal item, for example).
Portal users
A registered user of a portal is represented in the API by the PortalUser
class. When you have signed in to a portal, you can get authentication information relating to the authenticated user from the portal class.
A user must authenticate to access secured resources. The authentication method you decide to implement might vary based upon the resources required by your application. Esri's preferred authentication methods are:
-
User authentication: This method prompts users to sign in with an ArcGIS account and grants an OAuth access token associated with the account to the client app. The app uses this token in all subsequent requests to the platform. This is the recommended method, and is most commonly used with ArcGIS Online and ArcGIS Enterprise.
-
API key authentication: This type of authentication uses a long-lived access token to authenticate requests to ArcGIS services and portal items. For more information see the Introduction to API key authentication. Go to the Create an API key tutorial to obtain a new API Key access token. It is the recommended type of authentication for developers new to ArcGIS or to development in general.
For an overview of the ways to access secure services, see Security and Authentication.
Portal groups
Groups are a way to collaborate with other users who share a common interest. A group combines a list of portal items and a list of portal users. 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 PortalGroup
class.
ArcGIS Online
ArcGIS Online is a cloud-based mapping and analysis platform that provides an ArcGIS portal. With ArcGIS Online you can do things like:
- Create web maps
- Web enable your data
- Control how your maps, data, and applications are shared
- Find relevant and useful basemaps, data, and configurable GIS resources
- Manage content and users in your organization
Once your data is hosted, you can access the data as services from your applications. You can also create new content (items), search for users and groups, and manage sharing.
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.
Learn how to use ArcGIS Online in the ArcGIS Online documentation.
ArcGIS for organizations
To access all the capabilities of ArcGIS Online, your organization can purchase a subscription. With a subscription to ArcGIS Online, organizations can manage all of their geographic content in a secure, cloud-based Esri environment. Members of the organization can use maps to explore data, create and share maps and apps, and publish their data as hosted web layers. Administrators customize the website, invite and add members to the organization, and manage resources.
Learn more about ArcGIS for organizations at ArcGIS Online.
ArcGIS Location Platform
ArcGIS Location Platform is a Platform as a Service (PaaS) product that provides location services and tools to build location-aware applications. The platform includes an ArcGIS portal that provides access to these services and tools.
Unlike ArcGIS Online, which is a multi-user organization, ArcGIS Location Platform is a single-user organization, designed for one developer to access and manage their content and services. It is, however, an actual ArcGIS Online organization. Consequently, the user can invite ArcGIS Online users from other organizations to collaborate on content through the use of groups. Users in a group can share content with other ArcGIS Online users, and vice versa.
Learn more about ArcGIS Location Platform, including subscriptions and pricing, at ArcGIS Location Platform.
ArcGIS Enterprise
ArcGIS Enterprise provides you with the same core capabilities as ArcGIS Online except it's hosted on infrastructure you control, either in the cloud or on-premises, for controlled distribution of content.
Learn more about ArcGIS Enterprise.
Connecting to an instance of ArcGIS Enterprise portal is done in a very similar way to connecting to ArcGIS Online and is represented in the API by the same class, Portal
. Use the URL to the Enterprise portal website, along with an appropriate credential valid on that portal, or no credential if accessing public content anonymously.
Learn how to use ArcGIS Enterprise portal in the Portal for ArcGIS documentation.
Connect to a portal as an anonymous user
Your app can connect to www.arcgis.com
as an anonymous user. This is useful when you want to access public content without requiring the user to sign in. To do this, create a Portal
instance with the URL of the portal and specify the connection type as Portal.
.
// Creates and loads the portal.
let portal = Portal(url: URL(string: "https://www.arcgis.com")!, connection: .anonymous)
try await portal.load()
// Checks if the portal has loaded and prints the portal name.
if portal.loadStatus == .loaded {
guard let portalName = portal.info?.portalName else { return }
print(portalName)
}
From here, you can access public content in www.arcgis.com
. For example, you can do the following.
- Display a web map.
- Access the data stored in a portal item.
- Search for public content such as web maps, map services, map features, groups, and users.
However, there are many things you cannot do, such as: publish hosted layers, perform analysis in map viewer, create new web maps and scenes, interact with groups, edit data in a layer (unless the layer has public data collection enabled), and so on.
If you wish to connect to public content in your own ArcGIS Online organization, substitute your organization URL for www.arcgis.com
.
let portal = Portal(url: URL(string: "https://your-organization.maps.arcgis.com")!, connection: .anonymous)
You can also connect to an ArcGIS Enterprise portal as an anonymous user. This is done in the same way as connecting to ArcGIS Online, except that you should use a URL to the ArcGIS Enterprise portal, such as https
. For information on connecting to ArcGIS Enterprise, see the Getting started using ArcGIS Enterprise.
Not all organizations allow anonymous access to their portal. In those cases, users can still access any public content in the portal via the URL to the content.
Services
Feature service
Add, update, delete, and query feature data.
Vector tile service
Store and access vector tile data.
Map tile service
Store and access map tile data.
Tools
ArcGIS Online
Cloud-based GIS with tools to manage, analyze, and share hosted data.
Dashboard
Manage and monitor developer credentials, location service usage, and data storage.
For ArcGIS Location Platform developers only.
Map Viewer
Create, explore, and share web maps for 2D applications.
Scene Viewer
Create, explore, and share web scenes for 3D applications.
A portal is a website with tools that can be used to create, manage, access, and share geospatial content and data. It supports many different types of content such as web maps, web scenes, hosted layers, data services, and files. A portal also provides tools to create maps, scenes, and layers, import data, create data services, and manage users and groups in the organization.
In addition, a portal includes security and authentication capabilities, comprised of access controls for that portal's content, as well as authentication services for apps and users to gain access to a portal's secured content and tools.
As a developer, you can use a portal to manage developer credentials and create content and data services for your applications.
ArcGIS Location Platform, ArcGIS Online, and ArcGIS Enterprise all include portals which a developer can use to authenticate their apps and users, create or manage content, and control access to that content. For ArcGIS Location Platform and ArcGIS Online, the portal is hosted in Esri's infrastructure. For ArcGIS Enterprise, the portal is installed and hosted on infrastructure you control, either in the cloud or on-premises.
Learn more about working with portals in the Introduction to portals guide. See How to use authentication in the developer guide to learn more about creating and managing developer credentials.
ArcGIS Online
ArcGIS Online is a cloud-based mapping and analysis platform that provides an ArcGIS portal. With ArcGIS Online you can do things like:
- Create web maps
- Web enable your data
- Control how your maps, data, and applications are shared
- Find relevant and useful basemaps, data, and configurable GIS resources
- Manage content and users in your organization
Once your data is hosted, you can access the data as services from your applications. You can also create new content (items), search for users and groups, and manage sharing.
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.
Learn how to use ArcGIS Online in the ArcGIS Online documentation.
ArcGIS for organizations
To access all the capabilities of ArcGIS Online, your organization can purchase a subscription. With a subscription to ArcGIS Online, organizations can manage all of their geographic content in a secure, cloud-based Esri environment. Members of the organization can use maps to explore data, create and share maps and apps, and publish their data as hosted web layers. Administrators customize the website, invite and add members to the organization, and manage resources.
Learn more about ArcGIS for organizations at ArcGIS Online.
Portal items, users, and groups
Connect to public content
To connect to ArcGIS Online and access public content anonymously, you can begin by creating an Portal
instance (without authenticating with the portal).
// Creates and loads the portal.
let portal = Portal(url: URL(string: "https://www.arcgis.com")!, connection: .anonymous)
try await portal.load()
// Checks if the portal has loaded and prints the portal name.
if portal.loadStatus == .loaded {
guard let portalName = portal.info?.portalName else { return }
print(portalName)
}
From here, you can access public content; for example, you can
- Display a web map.
- Access the data stored in a portal item.
- Search for 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:
let portal = Portal(url: URL(string: "https://your-organization.maps.arcgis.com")!, connection: .anonymous)
Connect to secured content
let url = URL(string: "https://www.arcgis.com")!
do {
// Creates a credential and adds it to the credential store.
let credential = try await TokenCredential.credential(for: url, username: "username", password: "thePassword")
ArcGISEnvironment.authenticationManager.arcGISCredentialStore.add(credential)
} catch {
print("Failed to create the credential: \(error)")
}
// Creates and loads the portal.
let portal = Portal(url: url, connection: .authenticated)
try await portal.load()
// Checks if the portal is loaded and prints user's full name.
if portal.loadStatus == .loaded {
guard let fullName = portal.user?.fullName else { return }
print(fullName)
}
ArcGIS Enterprise
ArcGIS Enterprise provides you with the same core capabilities as ArcGIS Online except it's hosted on infrastructure you control, either in the cloud or on-premises, for controlled distribution of content.
Learn more about ArcGIS Enterprise.
Connecting to an instance of ArcGIS Enterprise portal is done in a very similar way to connecting to ArcGIS Online and is represented in the API by the same class, Portal
. Use the URL to the Enterprise portal website, along with an appropriate credential valid on that portal, or no credential if accessing public content anonymously.
Learn how to use ArcGIS Enterprise portal in the Portal for ArcGIS documentation.
let url = URL(string: "https://geoportal.mycompany.com")!
do {
// Creates a credential and adds it to the credential store.
let credential = try await TokenCredential.credential(for: url, username: "username", password: "thePassword")
ArcGISEnvironment.authenticationManager.arcGISCredentialStore.add(credential)
} catch {
print("Failed to create the credential: \(error)")
}
// Creates and loads the portal.
let portal = Portal(url: url, connection: .authenticated)
try await portal.load()
// Checks if the portal is loaded and prints user's full name.
if portal.loadStatus == .loaded {
guard let fullName = portal.user?.fullName else { return }
print(fullName)
}
Samples
Services
Feature service
Add, update, delete, and query feature data.
Vector tile service
Store and access vector tile data.
Map tile service
Store and access map tile data.
Tools
ArcGIS Online
Cloud-based GIS with tools to manage, analyze, and share hosted data.
Dashboard
Manage and monitor developer credentials, location service usage, and data storage.
For ArcGIS Location Platform developers only.
Map Viewer
Create, explore, and share web maps for 2D applications.
Scene Viewer
Create, explore, and share web scenes for 3D applications.