Service to access security information of ArcGIS services like ArcGIS Enterprise portal.

interface PortalLoginService {
    getPortalCredential(): any;
    getPortalUserSelfInfo(): Promise<Record<string, any>>;
    isSignedIn(): boolean;
    on<Name extends EventNames<PortalLoginServiceEvents>>(
        eventName: Name,
        callback: EventCallback<PortalLoginServiceEvents[Name]>,
    ): EventHandle;
    on(eventName: "*", callback: EventCallback<void>): EventHandle;
    on(
        eventName: string | string[],
        callback: EventCallback<unknown>,
    ): EventHandle;
    signIn(): Promise<any>;
    signOut(): void;
}

Hierarchy (View Summary)

Methods

  • Gets the token for the portal or undefined if user is not signed in.

    Returns any

    The user's credentials.

  • Gets the response of the community/self endpoint of ArcGIS Online or undefined if user is not signed in.

    Returns Promise<Record<string, any>>

  • Checks if the user is signed in to ArcGIS Online

    Returns boolean

  • Register event listener for specific events.

    Type Parameters

    Parameters

    Returns EventHandle

    a handle to unregister from the event

  • Register event listener for any event.

    Parameters

    • eventName: "*"

      must be "*" for this overload

    • callback: EventCallback<void>

      the event handler callback will be invoked when any event has been emitted

    Returns EventHandle

    a handle to unregister from the events

  • Register event listener for the events listed in eventName. Comma separated event names are possible, for example "eventA,eventB".

    Parameters

    • eventName: string | string[]

      the event name or list of names

    • callback: EventCallback<unknown>

      the event handler callback

    Returns EventHandle

    a handle to unregister from the event(s)

  • Forces a sign-in to ArcGIS Online. The user is prompted to enter credentials.

    Returns Promise<any>

    The user's credentials, wrapped in a promise.

  • Clears all ArcGIS Online Tokens.

    Returns void