Forum Discussion

RubenM55's avatar
RubenM55
Occasional Contributor
2 years ago

V3.0 Authenticate with user and password and bearer

I'm trying to authenticate using user and password but I have two problems:
1. I need to change the name of fields "Username" and "Password" for "email" and "pw".

2. When I see the curl, it is sending: 

-H 'Authorization: Basic cnViZW4ubWFnYW5

 and I need to see 

-H 'Authorization: Bearer cnViZW4ubWFnYW5

but if I change the securityScheme definition from basic to bearer, it requires me the token and no user and password. 

  • Hi RubenM55 ,

     

    It sounds like you have a less-than-usual use-case for having a base64 encoded pair with the Bearer prefix. SwaggerUI tries to support the majority of use-cases of OpenAPI and in this case I don't know any way of describing that security requirement within the specification. Unfortunately that would be out of scope for SwaggerUI