Last active
December 14, 2015 11:37
-
-
Save VisualBean/d5ee54d0ebb79d7474c0 to your computer and use it in GitHub Desktop.
Basic-Authentication for swaggers index.html
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function addBasicAuthorization() { | |
var username = $('#input_username').val(); | |
var password = $('#input_password').val(); | |
if (username && username.trim() != "" && password && password.trim() != "") { | |
var basicAuth = new SwaggerClient.PasswordAuthorization('basic', username, password); | |
window.swaggerUi.api.clientAuthorizations.add("basicAuth", basicAuth); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment