Table of Contents

Class InteractionUrl

Namespace
Fdyay.IdentityServer.Hosting
Assembly
Fdyay.IdentityServer.AspNetCore.dll

Builds the browser-facing URLs the server redirects to, honouring the application's path base.

public static class InteractionUrl
Inheritance
InteractionUrl
Inherited Members

Remarks

The interaction URLs on UserInteractionOptions are written relative to the application root (/account/signin), and Path excludes the path base. A host mounted under UsePathBase would therefore emit a Location the browser resolves against the origin — landing outside the application entirely — and a return URL the server would then refuse to recognise as its own. Every redirect target and return URL handed to a browser goes through here, so the path base is applied in exactly one place rather than at each call site.

Methods

CurrentRequest(HttpContext)

The current request rendered as a return URL, path base included.

public static string CurrentRequest(HttpContext context)

Parameters

context HttpContext

Returns

string

Remarks

This is the value handed to the login and consent pages so they can resume the protocol request. It must carry the path base: the browser resolves it against the origin, and IIdentityServerInteractionService.IsValidReturnUrl validates it in the same shape.

Resolve(HttpContext, string)

Resolves a configured interaction URL against the current request's path base.

public static string Resolve(HttpContext context, string configuredUrl)

Parameters

context HttpContext
configuredUrl string

Returns

string

Remarks

A configured value that is not application-relative is the host's own choice of target and is returned unchanged — prefixing an absolute URL would corrupt it.

Resolve(HttpContext, string, string, string?)

Resolves a configured interaction URL and appends a single query parameter.

public static string Resolve(HttpContext context, string configuredUrl, string parameterName, string? parameterValue)

Parameters

context HttpContext
configuredUrl string
parameterName string
parameterValue string

Returns

string