Skip to content

API Authentication

This page defines how clients authenticate to the Geoportal API and how the API responds to authentication and authorization failures.

/* TODO: add information on API keys. Add information in enterprise and if they qualify. */

Geoportal API authentication is session-based for browser clients:

  • The API is the trust boundary.
  • Successful sign-in establishes a secure server-managed session.
  • The browser receives a secure session cookie.
  • Protected endpoints validate session and permissions on every request.
  • API authentication traffic must use HTTPS/TLS.
  • Browser clients must send credentials (cookies) with requests.
  • Cross-origin clients must be explicitly allowed by API CORS policy.
  1. Client submits credentials over HTTPS.
  2. API validates credentials and account status.
  3. API creates session and sets secure cookie.
  4. Client calls protected endpoints with cookie-based session.

Enterprise Account (Microsoft Entra ID SSO)

Section titled “Enterprise Account (Microsoft Entra ID SSO)”
  1. Client starts SSO flow.
  2. User authenticates with Microsoft Entra ID.
  3. API validates the identity response.
  4. API creates Geoportal session and sets secure cookie.
  5. Client calls protected endpoints with cookie-based session.

Protected endpoints require a valid authenticated session.

If authentication succeeds, authorization is still evaluated per endpoint (organization access, roles, and permissions).

Use these semantics consistently across protected routes:

StatusMeaningClient Action
200 / 2xxRequest authorized and successfulContinue normal flow.
401 UnauthorizedAuthentication missing, expired, or invalidRedirect to login or restart auth flow.
403 ForbiddenAuthenticated but not permitted for resource/actionShow access denied or request elevated access.
401 UnauthorizedExpired CredentialsAPI returns 401 Unauthorized. Session is treated as no longer valid. Client should prompt user to sign in again.
401 UnauthorizedInvalid or Tampered CredentialsAPI returns 401 Unauthorized. API does not expose sensitive validation details in client-facing responses. Events are logged and monitored for abuse detection.

Geoportal session cookies are configured for secure browser use:

  • HttpOnly to prevent JavaScript access.
  • Secure to require HTTPS transport.
  • SameSite to reduce cross-site request risk.
  • Bounded session lifetime with expiration handling.
  • This API reference is authentication-system agnostic at the protocol level.
  • Internal provider configuration and identity plumbing may evolve.
  • Public client behavior and status-code contract in this page are the stable integration surface.