|
|
|
|
|
by Abundnce10
3383 days ago
|
|
We started in 2014 with a Ruby on Rails monolith and Angular frontend, both of which were good ways to move fast while we were very small. We use Webpack to build our frontend apps, and serve them using the Rails Asset Pipeline. Within your MVP how did you handle authentication between your Angular apps and your Rails backend? I know you implemented Paladin to handle auth between your new microservices but I'm curious what auth looked like in your MVP. Thanks! |
|
When we first started we used a pretty vanilla version of Devise. The angular application just used session based auth. The easiest way to get the MVP happening was to have Rails generate the landing page of the SPA so we got sessions for 'free'. As we started to add more options for authenticating to the application to handle micro-services and our mobile application we took advantage of Warden/Devise and implemented a custom strategy for handling JWT authentication in addition to the regular session based strategy that comes out of the box.
The JWT authentication is Guardian compatible since we use Guardian to drive Paladin. It was a relatively straight forward addition with Warden/Devise to provide authentication based on either strategy which allows us to take advantage of these different schemes with minimal updates to our core application.