Issue Encountered: Could never properly redirect back to our Angular2 application after successful social based authentication. We were encountering a 404 (file not found) redirect issue in an Angular2 app after successfully authenticating via Google oAuth login. I was running my Angular application on Tomcat 9 and had the app running under an application context and not in the root (default-context> of the server. For example /example-application/index.html. The problem was the oAuth callback success url was set to /example-application/social-login-success?token= and you would just always get back a 404 error because the application/web server (Tomcat) was not able to retrieve a file at that location. That url is actually an Angular route that the angular router needs to handle, but the router was never being reached. Solution: Add a redirect at the tomcat level. 1) Create a WEB-INF folder at location of your application root <Tomcat-root>/<example-app
Document your REST API with Swagger Swagger is a great tool to allow you do document your REST based APIs and provides an interactive sandbox for clients or testers to interact with the API. Certainly go and check out what Swagger has to offer at Swagger.io . However as I found as of 2016, most of the examples available on the web regarding how to get Swagger up and running details what to do when you are using Spring-boot. Therefore I'm providing my write up to assist anyone who is trying to make swagger available form a SpringMVC application. I had a surprising level of pain getting it to work, considering the lack of details regarding specifics for this type of application. As is becoming common in my posts, I will first provide you a quick summary of the stack (tools/framework in play). Things are constantly evolving and you will need to assess your frameworks and version versus what I used in May of 2016. Prerequisite stack: Spring-core 4.2.4-RELEASE Spring-