connexion icon indicating copy to clipboard operation
connexion copied to clipboard

Get the jwt from another field from header

Open mohameds786 opened this issue 5 years ago • 1 comments

Description

Hello.

I am using connexion for API. Actually I have generated python code for an API which use jwt token for security. The jwt token is got from the "Authorization" parameter of the request header. Is it possible to customize this behavior in order to get it from another parameter?

Expected behaviour

Imagine that in the HTTP header I have Authorization: "something but not the jwt" JWT-Authorization: "something which is the jwt"

When I call an operation of my API, I want the security_controller to get "something which is the jwt" as the JWT but actually it takes "something but not the jwt"

Does someone have an idea?

Thank you very much

mohameds786 avatar May 26 '20 09:05 mohameds786

Since bearer authentication requires a header called "Authorization", how about using api key authentication, where the header name can be freely chosen?

In this example "X-Auth" is used as header name.

apatap avatar Nov 24 '20 23:11 apatap

This is according to spec.

RobbeSneyders avatar Nov 01 '23 17:11 RobbeSneyders