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

Flasgger doesnt support basic auth #103

Closed
Anshul21 opened this issue May 18, 2017 · 3 comments
Closed

Flasgger doesnt support basic auth #103

Anshul21 opened this issue May 18, 2017 · 3 comments

Comments

@Anshul21
Copy link

@Anshul21 Anshul21 commented May 18, 2017

Following is my spec

"""
    This is the  user status API
    Call this api passing a linkedin user email and get back their status
    ---
    swagger: "2.0"
    tags:
      - User Status API
    securityDefinitions:
      basicAuth:
        type: basic
    parameters:
      - name: user_email
        in: path
        type: string
        required: true
        description: The user's email
    security:
      - basicAuth: []
    responses:
      500:
        description: Exception occurred during processing request
      400:
        description: No status found for user
      200:
        description: User's status
        schema:
          id: user_email
          properties:
            user:
              type: string
              description: The User's email
              default: xxxx@abc.com
            user_status:
              type: string
              description: The user'status
              default: completed

    """



Everything works fine except the basic auth
screen shot 2017-05-18 at 9 27 16 am

@rochacbruno
Copy link
Member

@rochacbruno rochacbruno commented Jun 8, 2017

I need help to resolve this

@frizner
Copy link

@frizner frizner commented Aug 15, 2017

I've resolved the issue of authentication using the next code:
swagger_template = { ..., 'securityDefinitions': { 'basicAuth': { 'type': 'basic' } }, ... }
app = Flask(__name__)
Swagger(app, config=config[config_name].swagger_config, template=swagger_template)

image

@rochacbruno
Copy link
Member

@rochacbruno rochacbruno commented Aug 15, 2017

@frizner it would be nice to add it as an example and also include the image and code snippet in README.md

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.