private void getOAuth2AuthorizationServerMetadataEndpoint(OpenAPI openAPI, SecurityFilterChain securityFilterChain, boolean openapi31) {
		Class<OAuth2AuthorizationServerMetadataEndpointFilter> authorizationServerMetadataEndpointClass = OAuth2AuthorizationServerMetadataEndpointFilter.class;
		Object oAuth2EndpointFilter =
				new SpringDocSecurityOAuth2EndpointUtils(authorizationServerMetadataEndpointClass).findEndpoint(securityFilterChain);
		if (oAuth2EndpointFilter != null) {
			ApiResponses apiResponses = new ApiResponses();
			buildApiResponsesOnSuccess(apiResponses, AnnotationsUtils.resolveSchemaFromType(SpringDocOAuth2AuthorizationServerMetadata.class, openAPI.getComponents(), null, openapi31));
			buildApiResponsesOnInternalServerError(apiResponses);
			Operation operation = buildOperation(apiResponses);
			Field field = ReflectionUtils.findField(authorizationServerMetadataEndpointClass, "DEFAULT_OAUTH2_AUTHORIZATION_SERVER_METADATA_ENDPOINT_URI");
			if (field != null) {
				ReflectionUtils.makeAccessible(field);
				String defaultOauth2MetadataUri = (String) ReflectionUtils.getField(field, null);
				openAPI.getPaths().addPathItem(defaultOauth2MetadataUri, new PathItem().get(operation));
				operation = buildOperation(apiResponses);
				operation.addParametersItem(new PathParameter().name("subpath").schema(new StringSchema()));
				operation.summary("Valid when multiple issuers are allowed");
				openAPI.getPaths().addPathItem(defaultOauth2MetadataUri + "/{subpath}", new PathItem().get(operation));
			}
		}
	}
Gets o auth 2 authorization server metadata endpoint.

@param openAPI             the open api
@param securityFilterChain the security filter chain
@param openapi31           the openapi 31
springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocSecurityOAuth2Customizer.java