Skip to content

Swagger UI OAuth2 not working due to missing oauth2-redirect.html #1097

@Devristo

Description

@Devristo

image

In the Swagger UI its possible to authorize the client using OAuth2. Currently in the NelmioApiDocBundle this is not working due to two issues:

  • Parameter oauth2RedirectUrl can not be configured (this defaults to http://localhost:3000/oauth2-redirect.html).
  • The oauth2-redirect.html itself is missing. This file is responsible for retrieving the OAuth token and setting the Bearer token in subsequent requests from the Swagger UI.

As a simple test I copied the https://github.com/swagger-api/swagger-ui/blob/master/dist/oauth2-redirect.html in my web root and exposed it on http://localhost:3000/oauth2-redirect.html and then it seems to be working.

However it would be much easier if NelmioApiDocBundle included this file and set the oauth2RedirectUrl to a absolute URL generated by for example a route to this view.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions