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

How to add POST /authentication to create the JWT? #136

Closed
alinex opened this issue Mar 25, 2019 · 1 comment
Closed

How to add POST /authentication to create the JWT? #136

alinex opened this issue Mar 25, 2019 · 1 comment

Comments

@alinex
Copy link

alinex commented Mar 25, 2019

Steps to reproduce

I use JWT authentication through the /authentication path, but I am missing a possibility to easily create the JWT through Swagger. It is only possible to authenticate in swagger with an already retrieved JWT.

Expected behavior

I would like to have an /authorization POST call to be used like all the other services.
Or directly allow to generate the token within the authorization dialog of swagger.

Actual behavior

Only normal services are shown with their methods, not the authentication service.

System configuration

My config looks like:

  security: [
    {
      APIKeyHeader: []
    }
  ],
  securityDefinitions: {
    APIKeyHeader: {
      type: "apiKey",
      name: "Authorization",
      in: "header"
    }
  }

I am using:

├─┬ feathers-swagger@0.7.2
│ ├─┬ swagger-ui@3.21.0
│ │ ├─┬ swagger-client@3.8.25
│ └── swagger-ui-dist@3.21.0
@Mairu
Copy link
Collaborator

Mairu commented Jun 8, 2019

This is not directly related to feathers-swagger. But as I was also interested in this feature I wrote a plugin for Swagger UI to add the possiblity to create the bearer (jwt) token using a callback. In this callback you can call the authenticate endpoint.

I added it to the security example for openapi v3, but this should also work for swagger v2.

@Mairu Mairu closed this as completed in d9449db Jun 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants