scalar / scalar

Scalar is an open-source API platform:                                       🌐 Modern Rest API Client                                        📖 Beautiful API References                                        ✨ 1st-Class OpenAPI/Swagger Support
https://scalar.com
MIT License
7.33k stars 228 forks source link

Prefilling multiple authentication methods results in only one selected #3890

Open Xhale1 opened 2 hours ago

Xhale1 commented 2 hours ago

What happens?

I'm able to prefill two authentication methods, but only one is automatically selected. I can select the other auth method and it is properly prefilled, but it'd be great to have a way to force both to be selected.

Screenshot 2024-11-14 at 4 30 21 PM

What did you expect to happen?

Prefilling two authentication methods should select both methods, or there should be a config option to set multiple preferred authentication methods.

OpenAPI Document

No response

amritk commented 2 hours ago

Hello there, funnily enough someone just posted this issue!

Closing due to duplicate of https://github.com/scalar/scalar/issues/3887

Xhale1 commented 1 hour ago

@amritk I'm not sure if my issue is the same as the one linked, though I'll defer to your knowledge of course :)

In my case, the two authentication options have different types, and are defined like this:

securitySchemes: {
    apiKey: {
      type: "apiKey",
      name: "api-key",
      in: "header",
    },
    bearerAuth: {
      type: "http",
      scheme: "bearer",
      bearerFormat: "JWT",
    },
},

They're prefilled correctly by Scalar, but in my case only the apiKey is automatically selected (when I would expect both to be selected)

amritk commented 49 minutes ago

Oooh I see. Sure we can re-open