Class IssuerNameService
- Namespace
- Fdyay.IdentityServer.Hosting
- Assembly
- Fdyay.IdentityServer.AspNetCore.dll
Supports all classes in the .NET class hierarchy and provides low-level services to derived classes. This is the ultimate base class of all .NET classes; it is the root of the type hierarchy.
public sealed class IssuerNameService : IIssuerNameService
- Inheritance
-
IssuerNameService
- Implements
- Inherited Members
Constructors
IssuerNameService(IOptions<IdentityServerOptions>, IHttpContextAccessor)
Creates the service, as the container resolves it.
public IssuerNameService(IOptions<IdentityServerOptions> options, IHttpContextAccessor httpContextAccessor)
Parameters
optionsIOptions<IdentityServerOptions>The server options: the configured
IssuerUriand whether a derived issuer is lower-cased.httpContextAccessorIHttpContextAccessorReaches the request in flight, for the overload that takes none.
Methods
GetIssuer()
Gets the issuer for whatever context there is, or null when there is nothing to derive one from.
public string? GetIssuer()
Returns
Remarks
The same question as the overload above, asked without carrying a context to ask it with: the configured issuer, else the request in flight if there is one, else nothing. For callers that may or may not be inside a request — a background sweep, a hosted service, a host issuing a token of its own.
Nullable rather than throwing: "no request and no IssuerUri" is a real state a host can be in, and
it is not worth taking a background service down over. A caller that gets null is expected to say
so rather than carry on with a wrong issuer.
GetIssuer(HttpContext)
Gets the issuer for the current request.
public string GetIssuer(HttpContext context)
Parameters
contextHttpContext