Authorization key: Swagger-ui v3.0.2

I am using Swagger-ui version 3.0.2 , I hosted it locally and gave it my Json file and API, it opens document fine and lists all method in json file, after I put basic authentication in it, I made changes to JSON file changes

"securityDefinitions": {
"basic": {
        "type": "basic",
        "description": "Basic Authentication"
    },
    "token": {
        "type": "apiKey",
        "description": "API Token Authentication",
        "name": "apiKey",
        "in": "header"
    }
},

      

when i authenticate a user with username and password or using toen it shows it is authenticated but hasn't added the authentication key with CURL Swagger-ui 3.0.2 here is the attachment where the header is missing in the call. for reference. screenshot of swagger-ui2.2.8 version.enter image description here

Can anyone please explain how to attach authorization in header in swagger-ui version 3.0.2.

+3


source to share





All Articles