Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add cookies auth support #1621

Open
mrlubos opened this issue Jan 23, 2025 · 4 comments
Open

Add cookies auth support #1621

mrlubos opened this issue Jan 23, 2025 · 4 comments
Labels
feature 🚀 New feature or request

Comments

@mrlubos
Copy link
Member

mrlubos commented Jan 23, 2025

Context #1599 (comment)

@mrlubos mrlubos added the feature 🚀 New feature or request label Jan 23, 2025
@RabeeAbuBaker
Copy link

RabeeAbuBaker commented Jan 24, 2025

Yes please! After upgrading today I ran into this issue:

Previously, this setup worked without problems:

const client = createClient({
        baseUrl: BASE_API_URL,
        headers: {
            'Content-Type': 'application/json',
            'X-CSRFToken': csrfToken,
            cookie: cookieString,
        },
        throwOnError: true,
    })

However, after upgrading the following packages:

@hey-api/client-fetch: 0.5.0 ➡️ 0.7.1
@hey-api/openapi-ts: 0.58.0 ➡️ 0.62.3

I started receiving this warning:

❗️ SDK warning: unsupported security scheme. Please open an issue if you'd like it added https://github.com/hey-api/openapi-ts/issues
{
  "type": "apiKey",
  "in": "cookie",
  "name": "DSESSIONID"
}

and the solution above stopped working!

@mrlubos
Copy link
Member Author

mrlubos commented Jan 24, 2025

@RabeeAbuBaker uh oh, that doesn't sound right. The warning was a separate addition, but the fact your setup stopped working isn't the expected behaviour. Are you able to pinpoint what's failing? I assume baseUrl and throwOnError still works. Are all headers not being passed? Only cookie?

Ideally you'd be able to share a relevant part of your OpenAPI spec or StackBlitz example 🙏

@RabeeAbuBaker
Copy link

RabeeAbuBaker commented Jan 24, 2025

@RabeeAbuBaker uh oh, that doesn't sound right. The warning was a separate addition, but the fact your setup stopped working isn't the expected behaviour. Are you able to pinpoint what's failing? I assume baseUrl and throwOnError still works. Are all headers not being passed? Only cookie?

Ideally you'd be able to share a relevant part of your OpenAPI spec or StackBlitz example 🙏

Indeed, my bad! It is working. It was something else from my side that's messing it up.

@lsdch
Copy link
Contributor

lsdch commented Jan 30, 2025

Just upgraded to latest version and I am getting lots of warnings about the unsupported security scheme. Supporting cookie auth or providing a way to disable these warnings specifically would indeed be great 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature 🚀 New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants