Angular Rails app with authentication and token - ruby-on-rails

I am building a very simple app using angular js as frontend and rails as backend. When building only using rails, it was simple to use devise gem and work with rails views (erb). But now the scene is entirely different for me. I wish to keep both the codebases in separate repositories and run both servers separately (grunt and rails server). Here are my queries (if somebody could answer)
How to manage authentication ? I tried using angular devise but it was not overriding hostname and port for all requests, I had to do it for all type of requests. Also, devise renders its own views after authentication is complete or if it fails. For sessions#new controller, it never lets me override and does its own work.
Any other recommended approach/ a gist or a tutorial which can guide me to manage sessions between rails/angular js ? I am new to this approach (rails-angular thing)
Thanks alot in advance !

Devise is the best option for authentication.
For Rails backend follow this admin static content
For angular frontend follow this Angular Admin UI

Related

SSO integration using Rails for WordPress

I am building Rails Application which re-directs users to a WordPress Site. All exisiting users are in Rails Database.Now I want to use SSO from Rails App to Wordpress.
I came across this solution but
I am using custom authentication method instead of devise gem as called out in the solution.
Is there any other alternate methods to solve this?

Best authentication strategy for Ruby on Rails API only server (with ActiveAdmin)

I have a project where I want to develop the frontend in Next.js (requests based on fetch API from JS) and the backend in RoR and I am having a hard time to get the User authentication to work. I have researched and found four possible solutions:
Sessions and cookies
JWT
devise_token_auth
devise-jwt
I have tried to implement some of them but i always end up getting a server error on client requests at some point. I would like to know if anyone has any resources where I can get to know more about and learn more about it so I can implement such authentication in my project.
If I could take advantage of devise would be even better, since I already have it setup for ActiveAdmin (wanna use the admin dashboard)
Thanks a lot in advance.
I used to use devise, but have since moved to AWS Cognito which handles everything for you and is customizable as needed. You might look into it.
https://aws.amazon.com/cognito/

User authentication with Devise-jwt in Ruby On Rails as backend and Vuejs as frontend

I am usign Ruby on rails as backend and vuejs as frontend. I want to design complete user authentication as we do in ruby on rails using devise gem. I am very confused after googling and trying things. Please help me.
I found two projects that might help you, but the only difference is that front-end is Angular, below are the links
rails project
angular project

Devise authentication from different application

I have a perfectly working rails application including devise authentication.
I created a second separated rails application for the public website, which runs as separate heroku application.
The problem is: It should be possible to sign up and sign in to the main application using forms in the public website.
How is it possible to authenticate users using devise through a form in a different application? What's the best approach?
If your applications use different subdomains but are under the same domain, this article might help.
And Chris Oliver took an approach to implement this in Rails 3.1 here

Ruby cramp authentication with devise

There is RubyOnRails application with Devise authentication. Is there any smart way to add ruby Cramp framework to that application with devise support?
One devise session for both rails and cramp
I am assuming that you want to run Cramp for something like chat within your application. If you provided more info about what you are trying to accomplish, it would help get you a more appropriate answer. If you're building a chat tool, or some kind of stat logging service, it would probably make more sense to build it outside of Rails and integrate the two through an API. Just a thought.

Resources