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

How to verify/check the credentials using the authorize button in Swagger UI #624

Open
Sanket-Shinde-dev opened this issue Nov 4, 2024 · 0 comments
Labels
question Further information is requested

Comments

@Sanket-Shinde-dev
Copy link

I'm working on a Flask-RESTful API and I'm trying to implement basic authentication using the HTTPBasicAuth class. I've included the authorizations dictionary in my API definition, but I'm encountering an issue where the credentials are not being verified when I use the "authorizationURL" parameter.

from flask import Blueprint from flask_restful import Api, HTTPBasicAuth api_v2_blueprint = Blueprint("api_v2", __name__) authorizations = { 'basicAuth': { 'type': 'basic', 'in': 'header', 'name': 'Authorization', 'authorizationUrl': 'https://xyz.com/login' } } api = Api( api_v2_blueprint, title="Api for tool1", version="2.0", description="Rest Api", authorizations=authorizations, security=authorizations ) auth = HTTPBasicAuth()

image

Expected Behavior:

I expect that the credentials should be verified by sending them to a API endpoint, and should be validated when they are added from the authorize button.

Actual Behavior:

The credentials even if they are wrong are stored when added through the "Authorize" button and when the API endpoint is hit, a browser pop-up box appears which asks for username and password again, but then upon adding the right credentials there, the wrong credentials(added via the authorize button) are sent to the API instead of new one

image

How can I use the authorize button to validate the credentials ?

@Sanket-Shinde-dev Sanket-Shinde-dev added the question Further information is requested label Nov 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant