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.
What I have?
A Spring Web MVC application with Spring Secuirity LDAP authentication.
What I want to achieve?
- 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).
- Application should connect with a third party Authorization server and get the OAuth2 access token and refresh token.
- Once the access token is received, application should create the session and serve the required resource asked in first step.
- When user clicks on logout or the session is expired, flow starts from first step.
What I have tried so far?
I have tried this with Spring boot and OIDC. But I am looking for some good reference to achieve the above with XML configuration. Please note that I can not use Spring Boot or any java configuration.
Any ideas or suggestions on how to start all this?
Thanks.
First, I must say that you can find good examples in Spring's oAuth Samples section.
Anyhow, I have created an oAuth-sample-project (GitHub) when I played with it a while back, so here are the interesting parts. Take into account that you have to learn a bit from the docs, and drill in the code... but I think it is good for a starting point.
The client XML:
full snippet is here.
the resource server XML:
file can be found here.
I think here is not a good place to explain every bit and byte, but again - in Spring docs you can find great explanations (I managed to learn all from there...)