Reputation: 983
I have multiple web applications with angularjs in the frontend and servlets in the backend. Requests are made using ajax call. Servlets then initializes java objects which fetches data using JDBC connection and returns the result.
Upvotes: 2
Views: 1654
Reputation: 19547
Just curious, have you seen the Stormpath Java SDK? There is also a feature called ID Site that gives you a single login location for the apps you build (if you want to use it - it's optional).
A Stormpath Java SDK update will be released shortly that automates this even further for servlet-based web apps, including token authentication via OAuth 2. For example:
Account account = request.getAttribute("account");
No server-side coding required to enable this :)
If you want early access to try this out, here is the branch: https://github.com/stormpath/stormpath-sdk-java/tree/servlet-module
And a sample application showing how to enable it: https://github.com/stormpath/stormpath-sdk-java/tree/servlet-module/examples/servlet
The SDK is 100% open source via the business-friendly Apache 2 license.
Disclosure: I'm Stormpath's CTO, but also an open-source security advocate - whether you use Stormpath or not, I'd like to see that everyone can easily secure apps.
Upvotes: 2