title: Spring OAuth2 XML configuration for Client and Resource Server
body: <p>Can any one help me with a very basic configuration in XML to act my spring application as OAuth2/OIDC Resource serer and as well as cilent.</p>
  <p><strong>What I have?</strong></p>
  <p>A Spring Web MVC application with Spring Secuirity LDAP authentication.</p>
  <p><strong>What I want to achieve?</strong></p>
  <ol>
  <li>If user tries to access any resource(e.g. index.html) in my application, he should be asked for his credentials(can be popup or can be a redirect to login page).</li>
  <li>Application should connect with a third party Authorization server and get the OAuth2 access token and refresh token.</li>
  <li>Once the access token is received, application should create the session and serve the required resource asked in first step.</li>
  <li>When user clicks on logout or the session is expired, flow starts from first step.</li>
  </ol>
  <p><strong>What I have tried so far?</strong></p>
  <p>I have tried this with Spring boot and OIDC. But I am looking for some good reference to achieve the above with <strong>XML configuration</strong>. Please note that I can not use Spring Boot or any java configuration.</p>
  <p>Any ideas or suggestions on how to start all this?</p>
  <p>Thanks.</p>