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

Open
Anshul21 opened this Issue May 18, 2017 · 3 comments

Comments

Projects
None yet
3 participants
@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

This comment has been minimized.

Show comment
Hide comment
@rochacbruno

rochacbruno Jun 8, 2017

Owner

I need help to resolve this

Owner

rochacbruno commented Jun 8, 2017

I need help to resolve this

@frizner

This comment has been minimized.

Show comment
Hide comment
@frizner

frizner 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

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

This comment has been minimized.

Show comment
Hide comment
@rochacbruno

rochacbruno Aug 15, 2017

Owner

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

Owner

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