Options
All
  • Public
  • Public/Protected
  • All
Menu

The ArcGisPortalSecurityContext contains the necessary information to be able to authenticate with ArcGIS Online, to initiate the authentication (perform a redirect to their OAuth login page), and to register a token with the {@link esri.IdentityManager} so that map service requests will use the supplied token from ArcGIS Online. All of these actions are performed through the initiate method.

Hierarchy

  • ArcGisPortalSecurityContext

Index

Constructors

constructor

  • Initializes a new instance of the ArcGisPortalSecurityContext class.

    Parameters

    • baseUrl: string

      The base URL of the ArcGIS Portal instance represented by this instance of the ArcGisPortalSecurityContext.

    • domains: string[]

      The collection of domains that the token result should be applied to.

    • clientId: string

      The ID of the client application.

    Returns ArcGisPortalSecurityContext

Properties

baseUrl

baseUrl: string

The base URL of the ArcGIS Portal instance (eg. "http://www.arcgis.com/sharing/")

clientId

clientId: string

The client ID (or application ID) of the application that we're accessing resources on behalf of.

domains

domains: string[]

A collection of domains that the token should be applied to. In other words, the ArcGIS Online token will be applied to any of the domains that match this collection.

error

An error if there is one. For example, if the user cancelled the log on process.

tokenResult

tokenResult: TokenResult

The stored token result.

Methods

appliesTo

  • appliesTo(serviceUri: string): boolean
  • Determines if the portal security represented by this instance should be applied to a particular service, located at the specified URI.

    Parameters

    • serviceUri: string

    Returns boolean

getLogOnUrl

  • getLogOnUrl(): string
  • Gets the URL of the OAuth2 login page (base url + oauth2/authorize).

    Returns string

getToken

  • getToken(serviceUri: string): string
  • Gets an ArcGIS Portal token for the service located at the specified URI, or null if a Portal token is not assigned to this service.

    Parameters

    • serviceUri: string

      The portal service URI.

    Returns string

initiate

  • initiate(): boolean
  • Ensures that we have a token available from an OAuth2 log on. Will redirect to the login page if a token has not yet been supplied in the URL.

    Returns boolean