frol / flask-restplus-server-example

Real-life RESTful server example on Flask-RESTplus
http://flask-restplus-example-server.herokuapp.com/api/v1/
MIT License
1.34k stars 342 forks source link

Questions regarding swagger-ui and oauth #83

Closed dhofstetter closed 6 years ago

dhofstetter commented 6 years ago

I used a lot of your stuff for a current project, because your enhancements are just awesome!

But actually I'm unable to get everything working regarding the swagger-ui. The authorize button is going to be displayed as expected. And I get the list of defined scopes. But as soon as I want to get myself authorized for the swagger session there are two possibilities:

I also saw that you set the client_id and realm for swagger within your config, but I don't know where you are going to render them for usage within the swagger-ui.

Can you help me?

BR Daniel

frol commented 6 years ago

First of all, implicit flow is not implemented yet #4.

Second of all, given that realm is set with config.SWAGGER_UI_OAUTH_REALM in the template, I am not sure how that part can be missing.

dhofstetter commented 6 years ago

Can you explain me how this config values are populated into the swagger-ui and how I can debug the authorization process? Is the authorization process within the function I mentioned above?

BR

frol commented 6 years ago

@dhofstetter I am sorry, I have little time this month to answer questions in details. See the HTML on the Swagger UI page (/api/v1/), and watch the network requests it sends/receives in the inspector.

frol commented 6 years ago

@dhofstetter Have you figured this out or you still need some help?

dhofstetter commented 6 years ago

I was able to do some workaround. Not a nice solution but works somehow!

Do you plan to integrate swagger ui 3 someday?

BR Daniel

frol commented 6 years ago

I was able to do some workaround. Not a nice solution but works somehow!

It would be helpful for others if you can share your workaround. There is also a chance that I will be able to help you to transform it to a proper solution.

Do you plan to integrate swagger ui 3 someday?

From the user perspective, I don't see much value in Swagger-UI 3 now as it is still lacking the features I use in this example (OAuth2 Password Flow, JSON editor) https://github.com/noirbizarre/flask-restplus/issues/267#issuecomment-384527203