Table of Contents

Class ApiResource

Namespace
Fdyay.IdentityServer.Models
Assembly
Fdyay.IdentityServer.Core.dll

Models a physical API resource: a named audience with its own scopes and secrets.

public class ApiResource : Resource
Inheritance
ApiResource
Inherited Members

Constructors

ApiResource()

An empty API resource, for an initializer or a configuration binder to fill.

public ApiResource()

ApiResource(string)

A API resource whose display name is its name.

public ApiResource(string name)

Parameters

name string

The unique name of the API resource.

Exceptions

ArgumentException

name is null or empty.

ApiResource(string, IEnumerable<string>)

A API resource whose display name is its name, carrying the user claims named.

public ApiResource(string name, IEnumerable<string> userClaims)

Parameters

name string

The unique name of the API resource.

userClaims IEnumerable<string>

The user claim types issued for it.

Exceptions

ArgumentException

name is null or empty.

ApiResource(string, string?)

A API resource with a display name.

public ApiResource(string name, string? displayName)

Parameters

name string

The unique name of the API resource.

displayName string

What the consent screen calls it.

Exceptions

ArgumentException

name is null or empty.

ApiResource(string, string?, IEnumerable<string>?)

A API resource with a display name, carrying the user claims named.

public ApiResource(string name, string? displayName, IEnumerable<string>? userClaims)

Parameters

name string

The unique name of the API resource.

displayName string

What the consent screen calls it.

userClaims IEnumerable<string>

The user claim types issued for it, or null for none.

Exceptions

ArgumentException

name is null or empty.

Properties

AllowedAccessTokenSigningAlgorithms

Signing algorithms this API accepts. Empty means the server default.

public ICollection<string> AllowedAccessTokenSigningAlgorithms { get; set; }

Property Value

ICollection<string>

ApiSecrets

Secrets used to authenticate at the introspection endpoint.

public ICollection<Secret> ApiSecrets { get; set; }

Property Value

ICollection<Secret>

RequireResourceIndicator

Whether this API is in an access token's audience only when the token request named it as a resource indicator (RFC 8707) — and then as the only audience. Defaults to false.

public bool RequireResourceIndicator { get; set; }

Property Value

bool

Remarks

For an API that will not accept a token another API could also accept, which is the replay an audience of several invites: any one of them holding the token could present it to the rest. Its scopes are still granted without an indicator, since another API may expose the same one; it is the audience it stays out of.

Scopes

The scopes this API resource claims.

public ICollection<string> Scopes { get; set; }

Property Value

ICollection<string>