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

Swagger UI: add support for OAuth2 authentication #1490

Closed
avas opened this issue Dec 6, 2018 · 2 comments
Closed

Swagger UI: add support for OAuth2 authentication #1490

avas opened this issue Dec 6, 2018 · 2 comments
Assignees

Comments

@avas
Copy link
Contributor

avas commented Dec 6, 2018

Problem:
Currently, Swagger UI relies on cookie-based authentication. But, as of #1476, the VirtoCommerce platform won't be using cookies for authentication anymore - it uses OAuth2 Password Grant Flow instead. It is not supported by the swagger-ui.js used in the platform, so the authentication fails for methods that require additional authorization, e.g. GET /api/platform/security/user/{userName}:
image

Solution:
The easiest solution would probably be to update the swagger-ui. Current version (3.20.1 at the moment of writing this) has built-in support for OAuth authentication:
image
image

Proposal of changes:

  • Install updated version of swagger-ui (from bower or directly from the swagger-ui repository);
  • Update the SwaggerConfig.cs to include it's files;
  • Apply VirtoCommerce branding to it;
  • Apply tags auto-collapsing;
  • Investigate what else had been changed in swagger-ui.js for VC Platform. If there were some valuable changes, they need to be applied too.
@tatarincev tatarincev added this to the Operations milestone Dec 6, 2018
@tatarincev tatarincev assigned pushnitsa and mvsmal and unassigned pushnitsa Dec 6, 2018
@tatarincev tatarincev assigned dvs39 and unassigned mvsmal Dec 11, 2018
@dvs39
Copy link

dvs39 commented Dec 13, 2018

swaggeroauth

@tatarincev
Copy link
Contributor

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

5 participants