Skip to content

Incorrect Handler being applied in AddApiKeyInHeader #13

Description

@maartenmensink

Found a small bug in the extension. The extension implies only header handling should be applied but the ApiKeyInHeaderOrQueryParamsHandler is applied

On line https://github.com/mihirdilip/aspnetcore-authentication-apikey/blob/master/src/AspNetCore.Authentication.ApiKey/ApiKeyExtensions.cs#L130 it should be ApiKeyInHeaderHandler instead of ApiKeyInHeaderOrQueryParamsHandler

public static AuthenticationBuilder AddApiKeyInHeader<TApiKeyProvider>(this AuthenticationBuilder builder, string authenticationScheme, string displayName, Action<ApiKeyOptions> configureOptions) where TApiKeyProvider : class, IApiKeyProvider
			=> builder.AddApiKey<TApiKeyProvider, ApiKeyInHeaderOrQueryParamsHandler>(authenticationScheme, displayName, configureOptions);

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions