This is a SAML authentication plugin for Swagger UI.
Add github npm registry to .npmrc
,
# .npmrc
always-auth = true
@dsaidgovsg:registry=https://npm.pkg.github.com
Install the package,
$ npm install @dsaidgovsg/swagger-ui-plugin-saml-auth
import samlAuthPlugin from '@dsaidgovsg/swagger-ui-plugin-saml-auth'
// swagger-ui initialization
SwaggerUI({
plugins: [
samlAuthPlugin,
...
]
})
components:
securitySchemes:
SamlAuth:
# base config
type: http
scheme: bearer
saml: true
# urls
loginUrl: /auth/saml/sso/
logoutUrl: /auth/saml/slo
security:
- SamlAuth: []