papsign/Ktor-OpenAPI-Generator

Problem with authentication

Closed this issue · 11 comments

We just recently changed from version 0.2-beta.14 to version 0.2-beta.18 and all the sudden the authentication method stop working.

We are using JWT Token to authenticate, now after updating the Authorization: Bearer is not added and when you click on the lock for the authenticated routes nothing shows in the authentication dialog.

image

Then we tested the different version and something changed from 14 to 15 that broke this for us. Do we need to change anything in the configuration. No error is being logged.

it's possible there was a regression

Any suggestion? An idea of what should we change?

do you have an implementation I can test to reproduce ?

when you said "It's possible there was a regression" what do you really mean by this? We are following the exact same example you have with the exception that we have both unauthorized routes and authorized ones.
Maybe that helps. Unfortunately I do not have an implementation for you to test.

can you send the openapi.json ?
Have you tried the openapi.json on Redoc, it is has a better implementation of the standard.
A commit between *.14 and *.18 changed the definition as it was not coherent with the standard.
The regression would be in the library, as a few PRs have been accepted since.

@RamsesGomez I just tested the JWT test and it has the authorization as expected... I did update a few libraries though, let me wrap that up so you can try.

@RamsesGomez try the latest release and tell me if it works

@Wicpar Awesome let me try thanks a lot for the swift response

I tested it but no luck I can see that the new generated json looks like this:

"security": [ { "entries": [ null ], "keys": [ "jwtAuth" ], "size": 1, "values": [ [ "Dummy" ] ] } ],

where as the old one looked like this:

"security": [ { "jwtAuth": [ "Dummy" ] } ],

You mentioned you have an example that worked is it possible to see that sample?

Ok We found the problem... we have a custom serialization module to be able to use kotlin serialization, and the SecurityModel now is a Map and that was the problem, all DataModel were being serialized differently but now is all good thanks a lot for the support much appreciated