Makes the last `initOAuth` variable configurable via environment variables in the swagger-ui docker image. Co-authored-by: Christopher Giroir <chrisgiroir@improbable.io> Co-authored-by: Tim Lai <timothy.lai@gmail.com>
70 lines
1.5 KiB
HTML
70 lines
1.5 KiB
HTML
<!-- HTML for dev server -->
|
|
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
<title>Swagger UI</title>
|
|
<style>
|
|
html
|
|
{
|
|
box-sizing: border-box;
|
|
overflow: -moz-scrollbars-vertical;
|
|
overflow-y: scroll;
|
|
}
|
|
|
|
*,
|
|
*:before,
|
|
*:after
|
|
{
|
|
box-sizing: inherit;
|
|
}
|
|
|
|
body
|
|
{
|
|
margin:0;
|
|
background: #fafafa;
|
|
}
|
|
</style>
|
|
</head>
|
|
|
|
<body>
|
|
<div id="swagger-ui"></div>
|
|
|
|
<script>
|
|
window.onload = function() {
|
|
window["SwaggerUIBundle"] = window["swagger-ui-bundle"]
|
|
window["SwaggerUIStandalonePreset"] = window["swagger-ui-standalone-preset"]
|
|
// Build a system
|
|
const ui = SwaggerUIBundle({
|
|
url: "https://petstore.swagger.io/v2/swagger.json",
|
|
dom_id: '#swagger-ui',
|
|
presets: [
|
|
SwaggerUIBundle.presets.apis,
|
|
SwaggerUIStandalonePreset
|
|
],
|
|
plugins: [
|
|
SwaggerUIBundle.plugins.DownloadUrl
|
|
],
|
|
layout: "StandaloneLayout"
|
|
})
|
|
|
|
window.ui = ui
|
|
|
|
ui.initOAuth({
|
|
clientId: "your-client-id",
|
|
clientSecret: "your-client-secret-if-required",
|
|
realm: "your-realms",
|
|
appName: "your-app-name",
|
|
scopeSeparator: " ",
|
|
scopes: "openid profile email phone address",
|
|
additionalQueryStringParams: {},
|
|
useBasicAuthenticationWithAccessCodeGrant: false,
|
|
usePkceWithAuthorizationCodeGrant: false
|
|
})
|
|
}
|
|
</script>
|
|
</body>
|
|
|
|
</html>
|