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

[BUG] [typescript-angular] bearer auth is handled like basic auth #1985

Closed
1 task
MBcom opened this issue Jan 25, 2019 · 4 comments
Closed
1 task

[BUG] [typescript-angular] bearer auth is handled like basic auth #1985

MBcom opened this issue Jan 25, 2019 · 4 comments

Comments

@MBcom
Copy link
Contributor

MBcom commented Jan 25, 2019

Bug Report Checklist

  • [x ] Have you provided a full/minimal spec to reproduce the issue?
  • [x ] Have you validated the input using an OpenAPI validator (example)?
  • [ x] What's the version of OpenAPI Generator used?
  • [x ] Have you search for related issues/PRs?
  • [x ] What's the actual output vs expected output?
  • [Optional] Bounty to sponsor the fix (example)
Description
  • generate a typescript angular package with configured bearer auth like
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
  • and the result in the generated package is that it trys to use basic authentication with username and password
  • the expected behaviour is too send the bearer token in the header of the api request
    -> look at my suggestions in the related pull request
openapi-generator version

4.0.0

OpenAPI declaration file content or url

look above

Command line used for generation
Steps to reproduce

generate a typescript-angular package with the open aip generator cli

Related issues/PRs

#1446, #1577, #457, #1930

Suggest a fix

look at the linked pull request

@auto-labeler
Copy link

auto-labeler bot commented Jan 25, 2019

👍 Thanks for opening this issue!
🏷 I have applied any labels matching special text in your issue.

The team will review the labels and make any necessary changes.

@maxfriedmann
Copy link

@MBcom, is this issue solved for you? I use the same securityScheme as you, and as expected by looking at your PR's content, my auth header gets prefixed with "Bearer ", and not "JWT ". I assume, the "bearerFormat" is ignored?

@MBcom
Copy link
Contributor Author

MBcom commented Mar 3, 2020

@maxfriedmann sry for late answer
you are right bearerFormat is not asumed to be the header prefix. We use Bearer <token> for JWT. I'm not sure was the standard says, but i thought the JWT is only the token format and Bearer the scheme.

@maxfriedmann
Copy link

@MBcom, yes, you're absolutely right, shame on me. After reading the official spec (https://jwt.io/introduction) I totally agree with you. bearerFormat relates to the format of the <token> of course.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants