question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

"Unknown security definition type" when using OpenApiSecuritySchemeType.Bearer schema

See original GitHub issue

Hi team,

So far setting up OpenApiSecurity as

       [OpenApiSecurity("jwt"
           , SecuritySchemeType.Http
           , Scheme = OpenApiSecuritySchemeType.Bearer
           , BearerFormat = "JWT"
           , In = OpenApiSecurityLocationType.Header)]

has only produced “Unknown security definition type” on SwaggerUI Authorize modal.

Is anything else needed to make it work?

Currently our workaround is abuse of apikey,

Going through documentation, we didn’t notice anything else that might be missing from configuration and according to it, bearer schema should be supported.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
justinyoocommented, Feb 10, 2022

public override OpenApiVersionType OpenApiVersion { get; set; } = OpenApiVersionType.V3;

You only need this.

2reactions
justinyoocommented, May 1, 2021

If you implement this interface, IOpenApiConfigurationOptions, you’ll be able to set V3 spec as a default behaviour.

samples/Microsoft.Azure.WebJobs.Extensions.OpenApi.FunctionApp.V3Static/Configurations/OpenApiConfigurationOptions.cs

Read more comments on GitHub >

github_iconTop Results From Across the Web

Using JWT bearer token configuration results in "Unknown ...
NET 6 Functions isolated V4 With the following configuration of OpenApi on ... we always get the message "Unknown security definition type"
Read more >
Jwt authentication implement in swagger api?
Hi am using Swager APi with nodejs. I am new to this technology. i was facing issue in my code. Tried to implement...
Read more >
Unable to import openapi 3 spec with bearer auth
I get the following error: Your API was not imported due to errors in the Swagger file. Unsupported security definition type 'http' for...
Read more >
Securing Azure Functions Endpoints via OpenAPI Auth
In this post, I'm going to discuss many options for securing Azure Functions endpoints through API key, bearer token, ...
Read more >
Authentication
The securityDefinitions section is used to define all security schemes (authentication types) supported by the API. It is a name->definition map that maps ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found