Overview

CAS takes advantages of Swagger to produce API documentation automatically. The generated documentation supports all CAS endpoints and REST APIs provided they are made available to the runtime application context and are present in the overlay.

Support is enabled by including the following dependency in the overlay:

1
2
3
4
5
<dependency>
    <groupId>org.apereo.cas</groupId>
    <artifactId>cas-server-support-swagger</artifactId>
    <version>${cas.version}</version>
</dependency>
1
implementation "org.apereo.cas:cas-server-support-swagger:${project.'cas.version'}"
1
2
3
4
5
6
7
8
9
dependencyManagement {
    imports {
        mavenBom "org.apereo.cas:cas-server-support-bom:${project.'cas.version'}"
    }
}

dependencies {
    implementation "org.apereo.cas:cas-server-support-swagger"
}
1
2
3
4
5
6
7
8
9
10
dependencies {
    /*
    The following platform references should be included automatically and are listed here for reference only.
            
    implementation enforcedPlatform("org.apereo.cas:cas-server-support-bom:${project.'cas.version'}")
    implementation platform(org.springframework.boot.gradle.plugin.SpringBootPlugin.BOM_COORDINATES)
    */

    implementation "org.apereo.cas:cas-server-support-swagger"
}

The following settings and properties are available from the CAS configuration catalog:

The configuration settings listed below are tagged as Required in the CAS configuration metadata. This flag indicates that the presence of the setting may be needed to activate or affect the behavior of the CAS feature and generally should be reviewed, possibly owned and adjusted. If the setting is assigned a default value, you do not need to strictly put the setting in your copy of the configuration, but should review it nonetheless to make sure it matches your deployment expectations.

The configuration settings listed below are tagged as Optional in the CAS configuration metadata. This flag indicates that the presence of the setting is not immediately necessary in the end-user CAS configuration, because a default value is assigned or the activation of the feature is not conditionally controlled by the setting value. In other words, you should only include this field in your configuration if you need to modify the default value or if you need to turn on the feature controlled by the setting.

The configuration settings listed below are tagged as Third Party in the CAS configuration metadata. This flag indicates that the configuration setting is not controlled, owned or managed by the CAS ecosystem, and affects functionality that is offered by a third-party library, such as Spring Boot or Spring Cloud to CAS. For additional info, you might have to visit the third-party source to find more details.

  • springdoc.api-docs.enabled=true
  • Whether to generate and serve an OpenAPI document.

    org.springdoc.core.properties.SpringDocConfigProperties$ApiDocs.

    How can I configure this property?

  • springdoc.api-docs.groups.enabled=false
  • The Enabled.

    org.springdoc.core.properties.SpringDocConfigProperties$Groups.

    How can I configure this property?

  • springdoc.api-docs.path=
  • Path to the generated OpenAPI documentation. For a yaml file, append ".yaml" to the path.

    org.springdoc.core.properties.SpringDocConfigProperties$ApiDocs.

    How can I configure this property?

  • springdoc.api-docs.resolve-extensions-properties=false
  • The Resolve extensions properties.

    org.springdoc.core.properties.SpringDocConfigProperties$ApiDocs.

    How can I configure this property?

  • springdoc.api-docs.resolve-schema-properties=false
  • The Resolve schema properties.

    org.springdoc.core.properties.SpringDocConfigProperties$ApiDocs.

    How can I configure this property?

  • springdoc.api-docs.version=
  • The OpenAPI version.

    org.springdoc.core.properties.SpringDocConfigProperties$ApiDocs.

    How can I configure this property?

  • springdoc.auto-tag-classes=true
  • The Auto tag classes.

    org.springdoc.core.properties.SpringDocConfigProperties.

    How can I configure this property?

  • springdoc.cache.disabled=false
  • The Disabled.

    org.springdoc.core.properties.SpringDocConfigProperties$Cache.

    How can I configure this property?

  • springdoc.consumes-to-match=
  • The Consumes to match.

    org.springdoc.core.properties.SpringDocConfigProperties.

    How can I configure this property?

  • springdoc.default-consumes-media-type=
  • The Default consumes media type.

    org.springdoc.core.properties.SpringDocConfigProperties.

    How can I configure this property?

  • springdoc.default-flat-param-object=false
  • The param default flatten

    org.springdoc.core.properties.SpringDocConfigProperties.

    How can I configure this property?

  • springdoc.default-produces-media-type=
  • The Default produces media type.

    org.springdoc.core.properties.SpringDocConfigProperties.

    How can I configure this property?

  • springdoc.default-support-form-data=false
  • convert query param to form data when consumes is multipart/form-data

    org.springdoc.core.properties.SpringDocConfigProperties.

    How can I configure this property?

  • springdoc.disable-i18n=false
  • The Disable i18n.

    org.springdoc.core.properties.SpringDocConfigProperties.

    How can I configure this property?

  • springdoc.enable-data-rest=true
  • The Enable hateoas.

    org.springdoc.core.properties.SpringDocConfigProperties.

    How can I configure this property?

  • springdoc.enable-default-api-docs=true
  • The Enable default api docs.

    org.springdoc.core.properties.SpringDocConfigProperties.

    How can I configure this property?

  • springdoc.enable-groovy=true
  • The Enable groovy.

    org.springdoc.core.properties.SpringDocConfigProperties.

    How can I configure this property?

  • springdoc.enable-hateoas=true
  • The Enable hateoas.

    org.springdoc.core.properties.SpringDocConfigProperties.

    How can I configure this property?

  • springdoc.enable-javadoc=true
  • The Enable javadoc.

    org.springdoc.core.properties.SpringDocConfigProperties.

    How can I configure this property?

  • springdoc.enable-kotlin=true
  • The Enable kotlin.

    org.springdoc.core.properties.SpringDocConfigProperties.

    How can I configure this property?

  • springdoc.enable-spring-security=true
  • The Enable spring security.

    org.springdoc.core.properties.SpringDocConfigProperties.

    How can I configure this property?

  • springdoc.group-configs=
  • The Group configs.

    org.springdoc.core.properties.SpringDocConfigProperties.

    How can I configure this property?

  • springdoc.headers-to-match=
  • The Headers to match.

    org.springdoc.core.properties.SpringDocConfigProperties.

    How can I configure this property?

  • springdoc.model-and-view-allowed=false
  • The Model and view allowed.

    org.springdoc.core.properties.SpringDocConfigProperties.

    How can I configure this property?

  • springdoc.model-converters.deprecating-converter.enabled=false
  • The Enabled.

    org.springdoc.core.properties.SpringDocConfigProperties$ModelConverters$DeprecatingConverter.

    How can I configure this property?

  • springdoc.model-converters.pageable-converter.enabled=false
  • The Enabled.

    org.springdoc.core.properties.SpringDocConfigProperties$ModelConverters$PageableConverter.

    How can I configure this property?

  • springdoc.model-converters.polymorphic-converter.enabled=false
  • The Enabled.

    org.springdoc.core.properties.SpringDocConfigProperties$ModelConverters$PolymorphicConverter.

    How can I configure this property?

  • springdoc.nullable-request-parameter-enabled=false
  • The Nullable request parameter enabled.

    org.springdoc.core.properties.SpringDocConfigProperties.

    How can I configure this property?

  • springdoc.override-with-generic-response=
  • The Override with generic response.

    org.springdoc.core.properties.SpringDocConfigProperties.

    How can I configure this property?

  • springdoc.packages-to-exclude=
  • The Packages to exclude.

    org.springdoc.core.properties.SpringDocConfigProperties.

    How can I configure this property?

  • springdoc.packages-to-scan=
  • The Packages to scan.

    org.springdoc.core.properties.SpringDocConfigProperties.

    How can I configure this property?

  • springdoc.paths-to-exclude=
  • The Paths to exclude.

    org.springdoc.core.properties.SpringDocConfigProperties.

    How can I configure this property?

  • springdoc.paths-to-match=
  • The Paths to match.

    org.springdoc.core.properties.SpringDocConfigProperties.

    How can I configure this property?

  • springdoc.pre-loading-enabled=false
  • Allow for pre-loading OpenAPI

    org.springdoc.core.properties.SpringDocConfigProperties.

    How can I configure this property?

  • springdoc.pre-loading-locales=
  • locale list to pre-loading

    org.springdoc.core.properties.SpringDocConfigProperties.

    How can I configure this property?

  • springdoc.produces-to-match=
  • The Produces to match.

    org.springdoc.core.properties.SpringDocConfigProperties.

    How can I configure this property?

  • springdoc.remove-broken-reference-definitions=true
  • The Remove broken reference definitions.

    org.springdoc.core.properties.SpringDocConfigProperties.

    How can I configure this property?

  • springdoc.show-actuator=false
  • The Show actuator.

    org.springdoc.core.properties.SpringDocConfigProperties.

    How can I configure this property?

  • springdoc.show-login-endpoint=false
  • The Show login endpoint.

    org.springdoc.core.properties.SpringDocConfigProperties.

    How can I configure this property?

  • springdoc.show-oauth2-endpoints=false
  • The Show oauth 2 endpoint.

    org.springdoc.core.properties.SpringDocConfigProperties.

    How can I configure this property?

  • springdoc.show-spring-cloud-functions=true
  • The Show spring cloud functions.

    org.springdoc.core.properties.SpringDocConfigProperties.

    How can I configure this property?

  • springdoc.sort-converter.enabled=false
  • The Enabled.

    org.springdoc.core.properties.SpringDocConfigProperties$SortConverter.

    How can I configure this property?

  • springdoc.swagger-ui.config-url=
  • URL to fetch external configuration document from.

    org.springdoc.core.properties.SwaggerUiConfigProperties.

    How can I configure this property?

  • springdoc.swagger-ui.csrf.cookie-name=
  • The Cookie name.

    org.springdoc.core.properties.SwaggerUiConfigProperties$Csrf.

    How can I configure this property?

  • springdoc.swagger-ui.csrf.enabled=false
  • The Enabled.

    org.springdoc.core.properties.SwaggerUiConfigProperties$Csrf.

    How can I configure this property?

  • springdoc.swagger-ui.csrf.header-name=
  • The Header name.

    org.springdoc.core.properties.SwaggerUiConfigProperties$Csrf.

    How can I configure this property?

  • springdoc.swagger-ui.csrf.local-storage-key=
  • The Local storage key.

    org.springdoc.core.properties.SwaggerUiConfigProperties$Csrf.

    How can I configure this property?

  • springdoc.swagger-ui.csrf.session-storage-key=
  • The Session storage key.

    org.springdoc.core.properties.SwaggerUiConfigProperties$Csrf.

    How can I configure this property?

  • springdoc.swagger-ui.csrf.use-local-storage=false
  • Use Local storage.

    org.springdoc.core.properties.SwaggerUiConfigProperties$Csrf.

    How can I configure this property?

  • springdoc.swagger-ui.csrf.use-session-storage=false
  • Use Session storage.

    org.springdoc.core.properties.SwaggerUiConfigProperties$Csrf.

    How can I configure this property?

  • springdoc.swagger-ui.deep-linking=
  • Enables or disables deep linking for tags and operations. @see deep-linking.md

    org.springdoc.core.properties.SwaggerUiConfigProperties.

    How can I configure this property?

  • springdoc.swagger-ui.default-model-expand-depth=
  • The default expansion depth for the model on the model-example section.

    org.springdoc.core.properties.SwaggerUiConfigProperties.

    How can I configure this property?

  • springdoc.swagger-ui.default-model-rendering=
  • Controls how the model is shown when the API is first rendered.

    org.springdoc.core.properties.SwaggerUiConfigProperties.

    How can I configure this property?

  • springdoc.swagger-ui.default-models-expand-depth=
  • The default expansion depth for models (set to -1 completely hide the models).

    org.springdoc.core.properties.SwaggerUiConfigProperties.

    How can I configure this property?

  • springdoc.swagger-ui.disable-swagger-default-url=false
  • The Disable swagger default url.

    org.springdoc.core.properties.SwaggerUiConfigProperties.

    How can I configure this property?

  • springdoc.swagger-ui.display-operation-id=
  • Controls the display of operationId in operations list.

    org.springdoc.core.properties.SwaggerUiConfigProperties.

    How can I configure this property?

  • springdoc.swagger-ui.display-request-duration=
  • Controls the display of the request duration (in milliseconds) for Try-It-Out requests.

    org.springdoc.core.properties.SwaggerUiConfigProperties.

    How can I configure this property?

  • springdoc.swagger-ui.doc-expansion=
  • Controls the default expansion setting for the operations and tags.

    org.springdoc.core.properties.SwaggerUiConfigProperties.

    How can I configure this property?

  • springdoc.swagger-ui.enabled=true
  • Whether to generate and serve an OpenAPI document.

    org.springdoc.core.properties.SwaggerUiConfigProperties.

    How can I configure this property?

  • springdoc.swagger-ui.filter=
  • If set, enables filtering. The top bar will show an edit box that could be used to filter the tagged operations that are shown.

    org.springdoc.core.properties.SwaggerUiConfigProperties.

    How can I configure this property?

  • springdoc.swagger-ui.groups-order=
  • The Groups order.

    org.springdoc.core.properties.SwaggerUiConfigProperties.

    How can I configure this property?

  • springdoc.swagger-ui.layout=
  • The name of a component available via the plugin system to use as the top-level layout for Swagger UI.

    org.springdoc.core.properties.SwaggerUiConfigProperties.

    How can I configure this property?

  • springdoc.swagger-ui.max-displayed-tags=
  • If set, limits the number of tagged operations displayed to at most this many.

    org.springdoc.core.properties.SwaggerUiConfigProperties.

    How can I configure this property?

  • springdoc.swagger-ui.oauth.additional-query-string-params=
  • The Additional query string params.

    org.springdoc.core.properties.SwaggerUiOAuthProperties.

    How can I configure this property?

  • springdoc.swagger-ui.oauth.app-name=
  • The App name.

    org.springdoc.core.properties.SwaggerUiOAuthProperties.

    How can I configure this property?

  • springdoc.swagger-ui.oauth.client-id=
  • The Client id.

    org.springdoc.core.properties.SwaggerUiOAuthProperties.

    How can I configure this property?

  • springdoc.swagger-ui.oauth.client-secret=
  • The Client secret.

    org.springdoc.core.properties.SwaggerUiOAuthProperties.

    How can I configure this property?

  • springdoc.swagger-ui.oauth.config-parameters=
  • org.springdoc.core.properties.SwaggerUiOAuthProperties.

    How can I configure this property?

  • springdoc.swagger-ui.oauth.realm=
  • The Realm.

    org.springdoc.core.properties.SwaggerUiOAuthProperties.

    How can I configure this property?

  • springdoc.swagger-ui.oauth.scope-separator=
  • The Scope separator.

    org.springdoc.core.properties.SwaggerUiOAuthProperties.

    How can I configure this property?

  • springdoc.swagger-ui.oauth.scopes=
  • The Scopes selected by default upon authentication.

    org.springdoc.core.properties.SwaggerUiOAuthProperties.

    How can I configure this property?

  • springdoc.swagger-ui.oauth.use-basic-authentication-with-access-code-grant=
  • The Use basic authentication with access code grant.

    org.springdoc.core.properties.SwaggerUiOAuthProperties.

    How can I configure this property?

  • springdoc.swagger-ui.oauth.use-pkce-with-authorization-code-grant=
  • The Use pkce with authorization code grant.

    org.springdoc.core.properties.SwaggerUiOAuthProperties.

    How can I configure this property?

  • springdoc.swagger-ui.oauth2-redirect-url=
  • OAuth redirect URL.

    org.springdoc.core.properties.SwaggerUiConfigProperties.

    How can I configure this property?

  • springdoc.swagger-ui.operations-sorter=
  • Apply a sort to the operation list of each API

    org.springdoc.core.properties.SwaggerUiConfigProperties.

    How can I configure this property?

  • springdoc.swagger-ui.path=
  • The path for the Swagger UI pages to load. Will redirect to the springdoc.webjars.prefix property.

    org.springdoc.core.properties.SwaggerUiConfigProperties.

    How can I configure this property?

  • springdoc.swagger-ui.persist-authorization=
  • The Persist authorization.

    org.springdoc.core.properties.SwaggerUiConfigProperties.

    How can I configure this property?

  • springdoc.swagger-ui.query-config-enabled=
  • The Query config enabled.

    org.springdoc.core.properties.SwaggerUiConfigProperties.

    How can I configure this property?

  • springdoc.swagger-ui.show-common-extensions=
  • Controls the display of extensions

    org.springdoc.core.properties.SwaggerUiConfigProperties.

    How can I configure this property?

  • springdoc.swagger-ui.show-extensions=
  • Controls the display of vendor extension (x-) fields and values.

    org.springdoc.core.properties.SwaggerUiConfigProperties.

    How can I configure this property?

  • springdoc.swagger-ui.supported-submit-methods=
  • The supported try it out methods

    org.springdoc.core.properties.SwaggerUiConfigProperties.

    How can I configure this property?

  • springdoc.swagger-ui.syntax-highlight.activated=
  • The Activated.

    org.springdoc.core.properties.SwaggerUiConfigProperties$SyntaxHighlight.

    How can I configure this property?

  • springdoc.swagger-ui.syntax-highlight.theme=
  • The Theme.

    org.springdoc.core.properties.SwaggerUiConfigProperties$SyntaxHighlight.

    How can I configure this property?

  • springdoc.swagger-ui.tags-sorter=
  • Apply a sort to the tag list of each API

    org.springdoc.core.properties.SwaggerUiConfigProperties.

    How can I configure this property?

  • springdoc.swagger-ui.try-it-out-enabled=
  • Try it out enabled

    org.springdoc.core.properties.SwaggerUiConfigProperties.

    How can I configure this property?

  • springdoc.swagger-ui.url=
  • The Url.

    org.springdoc.core.properties.SwaggerUiConfigProperties.

    How can I configure this property?

  • springdoc.swagger-ui.urls=
  • The Urls.

    org.springdoc.core.properties.SwaggerUiConfigProperties.

    How can I configure this property?

  • springdoc.swagger-ui.urls-primary-name=
  • The Urls primary name.

    org.springdoc.core.properties.SwaggerUiConfigProperties.

    How can I configure this property?

  • springdoc.swagger-ui.use-root-path=false
  • The Use root path.

    org.springdoc.core.properties.SwaggerUiConfigProperties.

    How can I configure this property?

  • springdoc.swagger-ui.validator-url=
  • URL to validate specs against.

    org.springdoc.core.properties.SwaggerUiConfigProperties.

    How can I configure this property?

  • springdoc.swagger-ui.version=
  • The Swagger ui version.

    org.springdoc.core.properties.SwaggerUiConfigProperties.

    How can I configure this property?

  • springdoc.swagger-ui.with-credentials=
  • The With credentials.

    org.springdoc.core.properties.SwaggerUiConfigProperties.

    How can I configure this property?

  • springdoc.use-fqn=false
  • Use fully qualified name

    org.springdoc.core.properties.SpringDocConfigProperties.

    How can I configure this property?

  • springdoc.use-management-port=false
  • If set to true, exposes the swagger-ui on the actuator management port.

    org.springdoc.core.properties.SpringDocConfigProperties.

    How can I configure this property?

  • springdoc.webjars.prefix=
  • The Prefix.

    org.springdoc.core.properties.SpringDocConfigProperties$Webjars.

    How can I configure this property?

  • springdoc.writer-with-default-pretty-printer=false
  • The Writer with default pretty printer.

    org.springdoc.core.properties.SpringDocConfigProperties.

    How can I configure this property?

  • springdoc.writer-with-order-by-keys=false
  • The Writer with order by keys.

    org.springdoc.core.properties.SpringDocConfigProperties.

    How can I configure this property?

    Configuration Metadata

    The collection of configuration properties listed in this section are automatically generated from the CAS source and components that contain the actual field definitions, types, descriptions, modules, etc. This metadata may not always be 100% accurate, or could be lacking details and sufficient explanations.

    Be Selective

    This section is meant as a guide only. Do NOT copy/paste the entire collection of settings into your CAS configuration; rather pick only the properties that you need. Do NOT enable settings unless you are certain of their purpose and do NOT copy settings into your configuration only to keep them as reference. All these ideas lead to upgrade headaches, maintenance nightmares and premature aging.

    YAGNI

    Note that for nearly ALL use cases, declaring and configuring properties listed here is sufficient. You should NOT have to explicitly massage a CAS XML/Java/etc configuration file to design an authentication handler, create attribute release policies, etc. CAS at runtime will auto-configure all required changes for you. If you are unsure about the meaning of a given CAS setting, do NOT turn it on without hesitation. Review the codebase or better yet, ask questions to clarify the intended behavior.

    Naming Convention

    Property names can be specified in very relaxed terms. For instance cas.someProperty, cas.some-property, cas.some_property are all valid names. While all forms are accepted by CAS, there are certain components (in CAS and other frameworks used) whose activation at runtime is conditional on a property value, where this property is required to have been specified in CAS configuration using kebab case. This is both true for properties that are owned by CAS as well as those that might be presented to the system via an external library or framework such as Spring Boot, etc.

    :information_source: Note

    When possible, properties should be stored in lower-case kebab format, such as cas.property-name=value. The only possible exception to this rule is when naming actuator endpoints; The name of the actuator endpoints (i.e. ssoSessions) MUST remain in camelCase mode.

    Settings and properties that are controlled by the CAS platform directly always begin with the prefix cas. All other settings are controlled and provided to CAS via other underlying frameworks and may have their own schemas and syntax. BE CAREFUL with the distinction. Unrecognized properties are rejected by CAS and/or frameworks upon which CAS depends. This means if you somehow misspell a property definition or fail to adhere to the dot-notation syntax and such, your setting is entirely refused by CAS and likely the feature it controls will never be activated in the way you intend.

    Validation

    Configuration properties are automatically validated on CAS startup to report issues with configuration binding, specially if defined CAS settings cannot be recognized or validated by the configuration schema. Additional validation processes are also handled via Configuration Metadata and property migrations applied automatically on startup by Spring Boot and family.

    Indexed Settings

    CAS settings able to accept multiple values are typically documented with an index, such as cas.some.setting[0]=value. The index [0] is meant to be incremented by the adopter to allow for distinct multiple configuration blocks.

    Endpoints

    The following Swagger endpoints may be used to analyze and test the APIs:

    Description URL
    Swagger API Specification https://sso.example.org/cas/v3/api-docs
    Swagger UI https://sso.example.org/cas/swagger-ui.html