-
Notifications
You must be signed in to change notification settings - Fork 63
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
Where to set security scheme to enable auth token to be sent #36
Comments
I have now got it working with auth, through trial and error, like this: In the
but this seems redundant, as that information is given by setting the |
Not at the moment since hooks don't add any additional information in to the service. Another way might be to set it globally as done in the Sequelize example in /~https://github.com/feathersjs/feathers-swagger/blob/master/example/sequelize/app.js#L52-L63 |
I got the security to work for the documentation as follow: in
The module is configured as follow:
You need to set the 'securityDefinisions' and the Then per service I can now set per route if this route needs authorization or not. So when you instantiate a service, you need:
I am passing a definition which allows: custom description of the endpoint, to add params definition, examples etc. For example if you want to limit a create route to authorized users:
As far as security is an array you can pass it other security strategies and of course you can pass other objects for each method here is another example with method definition:
I have externalised the params as I need to reuse the same one on other services. I hope this configuration may help someone ;) as it did not work right away... some trial and error involved... |
Example of authentication configuration was added to the repository. |
See /~https://github.com/feathersjs-ecosystem/feathers-swagger/blob/master/example/swagger-v2/security.js for a working example. You also have to define the securities for the services. |
Thank you so much @Mairu |
Just a question
The text was updated successfully, but these errors were encountered: