spring-guides / tut-spring-security-and-angular-js

Spring Security and Angular:: A tutorial on how to use Spring Security with a single page application with various backend architectures, ranging from a simple single server to an API gateway with OAuth2 authentication.

Home Page:https://spring.io/guides/tutorials/spring-security-and-angular-js/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Making Resource server standalone with out spring boot and using tomcat as target environment

areddy7021 opened this issue · comments

commented

I had an issue while making my existing REST API to security enabling with Oauth2. I am using completely annotation based and I have made my controller with preauthorize methods. I have followed your example and I have had issues while running the app with out spring boot. Here is the issue:

java.lang.IllegalArgumentException: An AuthenticationManager is required
    at org.springframework.util.Assert.notNull(Assert.java:112)

And the above message I am aware about that its about authentication manager but I do not want to include the part of code where authentication manager is in the resource server since I have already authentication manager in authentication server project . I am attaching my files what I have included in the resource server.
AuthQueryController.txt
MethodSecurityConfig.txt
OAuth2ResourceConfig.txt
OAuth2ResourceService.txt

Please help me what am I missing on making this with out spring boot. I have commented out the boot class.

The point of Spring Boot is to make this stuff easier for you, so you are making your life unnecessarily difficult if you decide not to use it. Maybe someone can help you on StackOverflow (if I were you I would create a sample project and link to it in your question), but it doesn't seem appropriate here.

commented

Thank you dave , I have figured it out and made a complete standalone applications with out spring boot. I agree with you that it's (boot) going to make things simpler. As of now , sticking to our basic principles to go with out spring boot.

@areddy7021 How you fixed this? I have the same issue