layout: default title: AuthenticationManager parent: Core Classes —

dymaptic.GeoBlazor.Core

dymaptic.GeoBlazor.Core.Model

AuthenticationManager Class

Manager for all authentication-related tasks, tokens, and keys

public class AuthenticationManager

Inheritance System.Object 🡒 AuthenticationManager

Constructors

AuthenticationManager(IJSRuntime, IConfiguration) Constructor

Default Constructor

public AuthenticationManager(Microsoft.JSInterop.IJSRuntime jsRuntime, Microsoft.Extensions.Configuration.IConfiguration configuration);

Parameters

jsRuntime Microsoft.JSInterop.IJSRuntime

Injected JavaScript Runtime reference

configuration Microsoft.Extensions.Configuration.IConfiguration

Injected configuration object

Properties

AuthenticationManager.ApiKey Property

Get or set the ArcGIS Application Api Key.

public string? ApiKey { get; set; }

Property Value

System.String

AuthenticationManager.AppId Property

Get or set the OAuth App ID.

public string? AppId { get; set; }

Property Value

System.String

AuthenticationManager.PortalUrl Property

The ArcGIS Enterprise Portal URL, only required if using Enterprise authentication.

public string? PortalUrl { get; set; }

Property Value

System.String

Methods

AuthenticationManager.EnsureLoggedIn() Method

Ensures that the user is logged in. If not, it will attempt to log them in.

public System.Threading.Tasks.Task EnsureLoggedIn();

Returns

System.Threading.Tasks.Task

AuthenticationManager.GetArcGisJsInterop() Method

Retrieves the correct copy of the ArcGisJsInterop based on the nuget package

public System.Threading.Tasks.Task<Microsoft.JSInterop.IJSObjectReference> GetArcGisJsInterop();

Returns

System.Threading.Tasks.Task<Microsoft.JSInterop.IJSObjectReference>

AuthenticationManager.GetCurrentToken() Method

Provides an implementation-agnostic way to fetch the current authentication token, whether it’s an OAuth token or an API Key

public System.Threading.Tasks.Task<string?> GetCurrentToken();

Returns

System.Threading.Tasks.Task<System.String>

AuthenticationManager.Initialize() Method

Initializes authentication based on either an OAuth App ID or an API Key. This is called automatically by MapView on first render, but can also be called manually for other actions such as rest calls.

public System.Threading.Tasks.Task<bool> Initialize();

Returns

System.Threading.Tasks.Task<System.Boolean>

AuthenticationManager.IsLoggedIn() Method

Tests to see if the user is logged in. True if yes, false if otherwise.

public System.Threading.Tasks.Task<bool> IsLoggedIn();

Returns

System.Threading.Tasks.Task<System.Boolean>
Returns a boolean value indicating whether or not the user is logged in.

AuthenticationManager.Login() Method

Initiates an OAuth login flow

public System.Threading.Tasks.Task Login();

Returns

System.Threading.Tasks.Task