title: OIDC authentication in springdoc-openapi-ui
body: <p>I'm migrating from the springfox project.</p>
  <p>How should I configure springdoc to enable popup where user can type username and password to authenticate in Keycloak using password flow? With the following setup I have no available authorizations in the list when pressing <code>Authorize</code> button</p>
  <p><a href="https://i.stack.imgur.com/g4IgU.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/g4IgU.png" alt="enter image description here" /></a></p>
  <h3>pom.xml</h3>
  <pre class="lang-java prettyprint-override"><code>...
  &lt;dependency&gt;
      &lt;groupId&gt;org.springdoc&lt;/groupId&gt;
      &lt;artifactId&gt;springdoc-openapi-ui&lt;/artifactId&gt;
      &lt;version&gt;1.6.9&lt;/version&gt;
  &lt;/dependency&gt;
  &lt;dependency&gt;
      &lt;groupId&gt;org.springdoc&lt;/groupId&gt;
      &lt;artifactId&gt;springdoc-openapi-security&lt;/artifactId&gt;
      &lt;version&gt;1.6.9&lt;/version&gt;
  &lt;/dependency&gt;
  ...
  </code></pre>
  <h3>OpenApiConfig.java</h3>
  <pre class="lang-java prettyprint-override"><code>@Bean    
  public OpenAPI api() {
    return new OpenAPI()
            ...
            .addSecurityItem(new SecurityRequirement().addList(&quot;OAuth&quot;))
            .components(
              new Components()
                .addSecuritySchemes(&quot;OAuth&quot;,
                  new SecurityScheme()
                    .name(&quot;OAuth&quot;)
                    .type(SecurityScheme.Type.OPENIDCONNECT)
                    .scheme(&quot;bearer&quot;)
              )
          );
  }
  </code></pre>
  <h3>application.yaml</h3>
  <pre class="lang-yaml prettyprint-override"><code>springdoc:
    swagger-ui:
      oauth:
        use-pkce-with-authorization-code-grant: true
        client-id: my-client
        clent-secret: my-client-secret
        realm: my-realm
        app-name: app-name
        oauth2RedirectUrl: https://keycloak.service.example.org
  </code></pre>