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
OAuth2 Password Flow is broken in Swagger UI 3.x #2774
Comments
@bodnia - can you take a look at this? I believe we fixed it in an alternative build, but maybe the fix didn't get here as well. @Minasokoni - if you try to load the provided spec, the global |
|
@sgdesmet there is no support for |
@bodnia Is this new for swagger-ui 3.x? It seems supported on 2.2.10 |
@sgdesmet |
#2774 display scopes for oauth2 password flow
@frol the error is caused by
As far as it has relative path fetch cannot call it. Following works ok:
Display and send scopes as query parameter is merged to latest |
@bodnia Oh, my! I am so sorry for the trouble! (It would be great to have a nicer error message there...) |
Any chance to get this patch-released please? |
@luispabon Do you experience any issues with this? In my case, that was just a stupid mistake in the |
@luispabon can you share your spec to look into this |
@frol the token url parameter is an absolute path to the auth endpoint. I had to anonymise and trim out the swagger.json spec as unfortunately I'm under NDA, but the following displays the same issue: {
"info": {
"title": " API v1",
"version": "1.0.0"
},
"host": "localhost:5000",
"basePath": "/v1",
"schemes": ["http"],
"securityDefinitions": {
"oauth2": {
"type": "oauth2",
"flow": "password",
"tokenUrl": "http://localhost:5000/oauth2/token",
"scopes": {
"openid": "Access your identity"
}
}
},
"swagger": "2.0",
"paths": {
"/foobars": {
"get": {
"description": "Get foobars sorted by date",
"parameters": [{
"$ref": "#/parameters/Page"
}, {
"$ref": "#/parameters/PageSize"
}],
"tags": ["Foobars"],
"responses": {
"200": {
"$ref": "#/responses/FoobarList"
}
}
}
},
"/foobars/{id}": {
"get": {
"description": "Get foobar",
"produces": ["application/json"],
"parameters": [{
"name": "id",
"description": "Foobar ID",
"in": "path",
"required": true,
"type": "string",
"default": "6472726"
}, {
"name": "viewMode",
"description": "View mode",
"in": "query",
"type": "string",
"enum": ["full", "list"],
"default": "full"
}],
"tags": ["Foobars"],
"responses": {
"200": {
"description": "Foobar",
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/definitions/Foobar"
}
}
}
},
"404": {
"$ref": "#/responses/NotFound"
}
}
}
}
},
"parameters": {
"Page": {
"name": "page",
"type": "integer",
"description": "Page number",
"in": "query",
"minimum": 1,
"default": 1
},
"PageSize": {
"name": "pageSize",
"type": "integer",
"description": "Page size",
"in": "query",
"minimum": 1,
"maximum": 100,
"default": 10
}
},
"tags": []
} |
The error is:
|
I've updated to 3.0.6 and the error is still the same:
Just to clarify, this is when clicking on 'authorise'; pressing enter while on the form shows no error output on the console even though it also fails to work. |
I can see no error output however on FF developer edition 54a2.(doesn't work either though). |
This is on current master:
|
@luispabon thanks for your comments, I am already looking into this error |
Thank you Anna, please let me know if I can help in any way. |
@luispabon the fix is in the latest master, please test |
@bodnia thank you, I'm doing it now |
@bodnia I can confirm this issue is now fixed, thanks for the hard work 👍 |
@luispabon thank you for the assistance in testing :) |
I use http://petstore.swagger.io/ with this config http://flask-restplus-example-server.herokuapp.com/api/v1/swagger.json.
First of all, there is no scopes selection, which seems to be the source of the following bug. If I just enter the credentials, I get the following traceback:
/cc @webron @bodnia @MugeSo @hkulekci @HugoMario @vpandey-rms @wimpers @bundabrg @danballance (I am sorry for the possible spam, but you were interested in the #2397, so I figured I would let you know about the issue).
The text was updated successfully, but these errors were encountered: