Class ReturnUrlParser
- Namespace
- Fdyay.IdentityServer.Services
- Assembly
- Fdyay.IdentityServer.AspNetCore.dll
Puts a return URL to every registered IReturnUrlParser.
public sealed class ReturnUrlParser
- Inheritance
-
ReturnUrlParser
- Inherited Members
Remarks
Deliberately not an IReturnUrlParser itself. It is resolved from the same container that holds the parsers, and implementing the interface it collects would put it in its own collection — an infinite recursion on the first call rather than a compile error.
Constructors
ReturnUrlParser(IEnumerable<IReturnUrlParser>)
Collects the registered parsers, asked in the order given.
public ReturnUrlParser(IEnumerable<IReturnUrlParser> parsers)
Parameters
parsersIEnumerable<IReturnUrlParser>Every registered IReturnUrlParser.
Exceptions
- ArgumentNullException
parsersis null.
Methods
IsValidReturnUrl(string?)
Whether any registered parser recognises the return URL.
public bool IsValidReturnUrl(string? returnUrl)
Parameters
returnUrlstring
Returns
ParseAsync(string?, CancellationToken)
The pending request the return URL names, from the first parser that can describe it.
public Task<IAuthenticationContext?> ParseAsync(string? returnUrl, CancellationToken cancellationToken = default)
Parameters
returnUrlstringcancellationTokenCancellationToken
Returns
Remarks
Each parser is asked, and the first non-null answer wins. A parser that recognises the URL but cannot resolve the request behind it — a reference that has expired, a client that has since been removed — answers null, and null from every parser is "not a request I can resume", which the interactive pages read as a reason to start again rather than as an error.