Skip to content

can you update the documentation to describe how to set up basic auth with the options object #112

@rubenabergel

Description

@rubenabergel

They are no documentation to help set up basic auth with the options object. Is it even possible?
here is what I have:

const express = require('express');
const router = express.Router();
const swaggerUi = require('swagger-ui-express');
const dashboardDocument = require('../dashboardAPI.json');
`const express = require('express');
const router = express.Router();
const swaggerUi = require('swagger-ui-express');
const dashboardDocument = require('../dashboardAPI.json');

var options = {
swaggerOptions: {
authAction: {
Basic: {
name: "user1",
schema: {
type:"application/json",
in: "header",
name: "Authorization",
},
value: "Basic bG9naW46cGFzc3dvcmQ="
}
}
}
}

router.use("/", swaggerUi.serve);
router.get("/", swaggerUi.setup(dashboardDocument, options));

module.exports = router;
`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions