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

Export authSchemes and securityDefinitions #65

Closed
superkhau opened this issue Oct 12, 2016 · 15 comments
Closed

Export authSchemes and securityDefinitions #65

superkhau opened this issue Oct 12, 2016 · 15 comments

Comments

@superkhau
Copy link
Contributor

From @JonnyBGod on May 10, 2016 20:6

We should be able to export auth specifications with swagger spec.

At least make it easy to hardcode it in options.

Copied from original issue: strongloop/loopback-component-explorer#162

@superkhau
Copy link
Contributor Author

From @JonnyBGod on May 10, 2016 20:9

It would be perfect if it was possible to easily integrate with loopback-component-oauth2

@superkhau
Copy link
Contributor Author

From @richardpringle on August 11, 2016 19:1

@JonnyBGod, should this be in loopback-swagger/issues?

@superkhau
Copy link
Contributor Author

From @gunjpan on October 11, 2016 20:10

@JonnyBGod : Could you please post this issue in the correct place as shown above?
Also, a sample/example to understand what you're proposing will definitely help within the description.
Closing this now. Thank you and have a great day!

@superkhau
Copy link
Contributor Author

@JonnyBGod I'm going to help move this issue over to the repo mentioned by @gunjpan and @richardpringle. Please add a better description of your issue there. I'll add a template you can edit there.

@superkhau
Copy link
Contributor Author

@JonnyBGod

<!--
- DO NOT ask questions using GitHub issues (only bug or feature requests please,
  see http://loopback.io/doc/en/contrib/Reporting-issues.html#asking-questions)

- Please ask questions at https://groups.google.com/forum/#!forum/loopbackjs or
  https://gitter.im/strongloop/loopback

- Immediate support is available through our subscription plans, see
  https://strongloop.com/node-js/subscription-plans
-->

### Bug or feature request

- [ ] Bug
- [ ] Feature request

### Description of feature (or steps to reproduce if bug)



### Link to sample repo to reproduce issue (if bug)



### Expected result



### Actual result (if bug)



### Additional information (Node.js version, LoopBack version, etc)


@gunjpan gunjpan removed their assignment Oct 12, 2016
@JonnyBGod
Copy link

Bug or feature request

  • Bug
  • Feature request

Description of feature (or steps to reproduce if bug)

The lib should generate swagger 2 Security Definitions Object. http://swagger.io/specification/#securityDefinitionsObject

This would enable the usage of proper authentication in swagger generated documentation pages such as http://petstore.swagger.io/. (check "Authorize" button)

Expected result

{
  "api_key": {
    "type": "apiKey",
    "name": "api_key",
    "in": "header"
  },
  "petstore_auth": {
    "type": "oauth2",
    "authorizationUrl": "http://swagger.io/api/oauth/dialog",
    "flow": "implicit",
    "scopes": {
      "write:pets": "modify pets in your account",
      "read:pets": "read your pets"
    }
  }
}

Additional information (Node.js version, LoopBack version, etc)

@JonnyBGod
Copy link

I believe the easiest way to configure this would be to enable the developer to configure the spec in config.json and export it.

@gunjpan gunjpan added feature and removed waiting labels Oct 18, 2016
@flvndvd
Copy link

flvndvd commented Mar 27, 2017

Hey there,

Is someone able to tell me if this feature is coming soon cause I need to find a way to expose my scopes required for each method in my swagger.json ? If no, do you have another way to expose the scope in the swagger.json ?

@drmikecrowe
Copy link

I have a work-in-progress that supports this (for my application). Still needs automated tests, but the results work perfectly in http://editor.swagger.io/#!/

https://github.com/drmikecrowe/loopback-swagger

@stale stale bot added the stale label Aug 23, 2017
@stale
Copy link

stale bot commented Aug 23, 2017

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@sebastianhaas
Copy link

Still an important issue for me to be resolved.

@bajtos
Copy link
Member

bajtos commented Sep 12, 2017

According to strongloop/loopback-component-explorer#209 (comment), we need to support authorization metadata in order to be able to use the latest version of Swagger UI.

@bajtos bajtos added the major label Sep 12, 2017
@drmikecrowe
Copy link

Continuing my OAuth2 work:

I created tasks on each of what is left open (as far as I can see). This is definitely targeting Loopback 2/3 projects, and working in an OAuth2 application we've rolled out.

@STRML
Copy link
Member

STRML commented Feb 27, 2018

@drmikecrowe Would you be willing to make a PR from the mergeable parts of exporting security and securityDefinitions (I see some work from @mike-zipit there in your branch) - this will help us get this through.

@bajtos
Copy link
Member

bajtos commented Apr 28, 2020

Closing as stale.

@bajtos bajtos closed this as completed Apr 28, 2020
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

8 participants