12

I have a full Spring application (security managed by spring-security and the controller Layer is build with Spring MVC).

I am using in the front-end AngularJS .

I need some example of how I will handle REST authentication with Spring Security and how I will call these services in the Angular side.

Note: Basic authentication will be perfect in my case .

2 Answers 2

9

Some code is needed to integrate AngularJS and Spring Security, as Spring Security wasn't meant to be used by a full Ajax framework.

Here is a sample application that does this integration, you will get both the Spring Security configuration and some classes used to do this integration:

https://github.com/jhipster/jhipster-sample-app

Sign up to request clarification or add additional context in comments.

Comments

1

One of the great things about AngularJS is that its pretty flexible and can operate with a number of different backend configurations. While I haven't personally used spring MVC or spring security I have used Angular with .NET MVC, Node, and PHP all with slightly different authentication systems and it worked out very well.

Dave Mosher has a great tutorial series that incorporates authentication concepts(his example is PHP with Laravel) but the concepts may be helpful: https://github.com/davemo/end-to-end-with-angularjs

For a more advanced example of authentication with AngularJS you might want to check out Angular-App: https://github.com/angular-app/angular-app

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.