Skip to content

Services IEndpointService

Mika Berglund edited this page Dec 25, 2025 · 2 revisions

Endpoint Service (IEndpointService)

The Endpoint Service resolves the OpenID Connect endpoint URIs required by Blazorade Id during authentication and token acquisition.

Responsibilities

  • Resolve endpoint URIs either from explicit configuration or from the OpenID Connect discovery document published by the configured authority.
  • Provide the essential endpoints used by Blazorade Id.
  • Expose additional standard OpenID Connect endpoints when available from the authority.

Members

  • GetAuthorizationEndpointAsync: Returns the authorization endpoint URI for the configured authority.
  • GetEndSessionEndpointAsync: Returns the end session endpoint URI for the configured authority.
  • GetTokenEndpointAsync: Returns the token endpoint URI for the configured authority.
  • GetUserInfoEndpointAsync: Returns the user info endpoint URI for the configured authority.
  • GetDeviceAuthorizationEndpointAsync: Returns the device authorization endpoint URI for the configured authority.
  • GetKerberosEndpointAsync: Returns the Kerberos endpoint URI for the configured authority.

Endpoint resolution behavior

The service uses the following precedence rules per endpoint:

  • If an endpoint URI is explicitly configured, it is returned as-is.
  • Otherwise, if a discovery document URI is configured, the service loads the discovery document and resolves the endpoint URI from it.
  • If neither an explicit endpoint URI nor a discovery document URI is available, the service returns null for optional endpoints.

Two endpoints are mandatory for Blazorade Id:

  • Authorization endpoint.
  • Token endpoint.

If either of these cannot be resolved, the default implementation throws.

Default implementation

The default implementation, EndpointService, depends on the following:

  • HTTP Service: Used to retrieve the discovery document over HTTP.
  • Authority options: Provide explicit endpoint overrides and the discovery document URI.

The default implementation supports the following endpoint sources:

  • Explicitly configured endpoint URIs.
  • OpenID Connect discovery metadata.

Configuration notes

The Endpoint Service relies on authority configuration that typically includes:

  • Authority discovery document URI.
  • Optional explicit endpoint overrides for the authorization endpoint, token endpoint, and end session endpoint.

If you configure explicit endpoint URIs, those will be used even when a discovery document URI is also configured.

Usage notes

  • Prefer discovery metadata when targeting standards-compliant OpenID Connect authorities. It reduces hard-coded endpoint configuration.
  • Use explicit endpoint overrides when the authority has non-standard endpoints, when discovery is not available, or when you need to pin endpoints.
  • Treat optional endpoints as capability-based. A null return value indicates the authority does not advertise the endpoint or it could not be resolved.

References

Clone this wiki locally