Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

OAuth2 Client And Resource Server in same application

I'm creating an Authentication Server and which some of my existing applications can use to authenticate. I'm using the OAuth2 with Spring Boot by following this sample project and tutorial https://github.com/dynamind/spring-boot-security-oauth2-minimal.

But in my case my existing applications are built using Spring MVC and angular. So there is no separate Resource Server. Resources are also located in same application(Resources are my Secured Request Mappings in same application).I just want to separate the authentication process from my client applications and use a common Authorization Server. (Currently they use the Google Authentication + Spring Security to secure the application). So I tried to use @EnableResourceServer and @EnableOAuth2Client in same application but I could not get the expected results.

What is the best way to achieve this task?? Is there any other method that I can follow to authenticate my applications from Oauth2 Server?

like image 710
Heshan Avatar asked Nov 08 '22 08:11

Heshan


1 Answers

You need to configure your web security for form based login and Resource Server Security form REST Endpoints

See my answer to the similar question here

like image 56
ejazazeem Avatar answered Nov 14 '22 22:11

ejazazeem