Table of Contents

Class ApiKeyAuthProvider

Namespace
JD.AI.Core.Security
Assembly
JD.AI.Core.dll

Simple API key authentication provider.

public sealed class ApiKeyAuthProvider : IAuthProvider
Inheritance
ApiKeyAuthProvider
Implements
Inherited Members

Methods

AuthenticateAsync(string, CancellationToken)

Validates a credential and returns the identity.

public Task<GatewayIdentity?> AuthenticateAsync(string credential, CancellationToken ct = default)

Parameters

credential string
ct CancellationToken

Returns

Task<GatewayIdentity>

RegisterKey(string, string, GatewayRole)

public void RegisterKey(string apiKey, string name, GatewayRole role = GatewayRole.User)

Parameters

apiKey string
name string
role GatewayRole