smallrye-open-api icon indicating copy to clipboard operation
smallrye-open-api copied to clipboard

Support for security scheme extension

Open hendrik-bammel opened this issue 3 years ago • 2 comments
trafficstars

I would like to have some possibility to add the tokenName extension to the openApi security scheme component using the quarkus application.properties. I'm using Microsoft as a provider for OpenIdConnect and therefore i got an access_token and an id_token. Thus i want to make this explicit in my interface description (and swagger can also use this information).

As i understand, an extension mechanism is part of the openAPi specification 3.0.3 ("https://swagger.io/specification" Caption: "Specification Extensions") and therefore should be usable in an easy way.

Some annotation as an alternative to properties would be also nice.

Small simple example for application.properties to clarify:

quarkus.smallrye-openapi.security-scheme=oidc
quarkus.smallrye-openapi.security-scheme-name=xxxNamexxx
quarkus.smallrye-openapi.oidc-open-id-connect-url=https://xxxURLxxx
quarkus.smallrye-openapi.security-scheme-extension=tokenName:id_token

could result to this generated content in openapi.yaml file:

components:
  securitySchemes:
    xxxNamexxx:
      type: openIdConnect
      description: Authentication
      openIdConnectUrl: https://xxxURLxxx
      x-tokenName: id_token

hendrik-bammel avatar Feb 25 '22 09:02 hendrik-bammel

For something like quarkus.smallrye-openapi.security-scheme-extension, I think that would be an issue in Quarkus.

As far as using annotations, that should be supported with https://github.com/eclipse/microprofile-open-api/issues/387 in MP OpenAPI 3.1, if all goes as planned.

MikeEdgar avatar Feb 25 '22 15:02 MikeEdgar

@hendrik-bammel i'll have a look at this a.s.a.p

phillip-kruger avatar Mar 30 '22 22:03 phillip-kruger