Using Windows Authentication in Ruby on Rails - ruby-on-rails

I'm working on a Rails app for an internal project and can't work out how to set up the users model to use Windows Authentication for logging in. I had a look and can't find anything that was covering this topic. I've managed to configure Rails to use SQLServer fine but I'm just blanking here.
Thanks in advance.

Maybe this article helps: http://www.zorched.net/2007/06/04/active-directory-authentication-for-ruby-on-rails/

Related

Visual Log Viewer for Ruby On Rails 4.2

I have worked previously on Laravel 4 and there is an awesome log viewer tool for it laravel log viewer view demo
I'm looking something very similar for Ruby on rails 4.2, if you guys know any good visual logging GEM for Rails 4.2 please let me know..
From code I need to log at different log levels, and this tool should visually organize my logs, thanks..
This should get you started https://github.com/shadabahmed/logstasher
As it says
This gem is heavily inspired from lograge, but it's focused on one
thing and one thing only. That's making your logs awesome like this
More here http://www.shadabahmed.com/blog/2013/04/30/logstasher-for-awesome-rails-logging/
Another simpler gem is https://github.com/dieb/browserlog - it just shows your default rails logs, in the browser, with syntax highlighting.
Also see:
https://github.com/discourse/logster
We use it in production across thousands of Discourse instances.

How to auto restart rails server with grunt?

I am working with rails-api so each time i change controller or Route file i want to auto reload rails server, so new changes will be applied.
I got basic setup to work with this plugin: link, where rails start together with grunt.
The problem is i want to reload rails server each time any rails files are changed.
Is it possible to achieve?
Yes, of course. You will need to use Guard for this purpose. Please read carefully Guards official page. They're doing good job in explaining how to setup your development environment.
There are tutorials on RailsCasts and also on NetTuts.
Edit: I forgot to mention that there is second(but definitely not the last one) option to achieve this. If you start using Spring which is Rails application preloader. Read more about this on Github page.
Here is great tutorial on how to setup everything together - http://girders.org/blog/2014/02/06/setup-rails-41-spring-rspec-and-guard/

Ruby on Rails application installer

I want to develop my rails application installer like in joomla in which we can configure database name, username, password, port, host etc. what is the best idea for it. I tried through rake tasks. But don't know is it good idea or not? Please help me.
Is it possible to configure rails application during runtime. If yes, how to configure?
Any ideas, tutorials, links. Thanks in advance.
What about capistrano? It's a great tool to deploy rails applications
I'll suggest you some links about it)
http://teachmetocode.com/screencasts/basic-deployment-with-capistrano/
http://railscasts.com/episodes/133-capistrano-tasks
http://guides.beanstalkapp.com/deployments/deploy-with-capistrano.html

Deploy rails site from local to justhost server

I am new to rails and this question might be very basic. I learnt ruby on rails to create a small site which i have tested on herokuapp as well.
Now, I want to deploy it in the actual site which is hosted on justhost.
How should the application be deployed? Is there any way we could move the herokuapp directly to the server?
Thanks in advance.
Have you tried checking their help section? This tutorial from their website should show you everything you need: https://my.justhost.com/cgi/help/upload-site

Authlogic_oauth2 alternative for Rails 2.3

In order to let users signup and login using facebook I used the authlogic_oauth2 gem (v.1.1.2) along with oauth2 (v. 0.0.10) and authlogic (2.1.6) in a Rails 2.3 application.
Everything worked well for more than 2 years but from a month or so, users are not able to login or signup with Facebook anymore.
I don't know what happened but I didn't changed anything so it seems that Facebook changed something on their end and authlogic_oauth2 doesn't seem to be able to work anymore.
Which could be the easiest way to fix the issue and bring back user login/signup with facebook?
Is there any better gem to help on the job?
Thanks in advance,
Augusto
I doubt that you may have done some changes in your present application unknowingly that caused the login and logout failures.
One possible cause of the problem might be the redirections from: http://yoursite.com to http://www.yoursite.com based on the changes that you made. Check the blog that mentions this problem.
The fix is to set: config.action_controller.session[:domain] = '.YOURDOMAIN.COM' inside of environment.rb (Make sure to prefix it with the .). That will make cookies work for both www.yourdomain.com and yourdomain.com (as well as any other subdomains).
I also recommend to check the login behavior in different environments: Development and Production and then check the output in the log files clearly.
This may help you to tweak the problem domain, as you mentioned that your code was working previously.
Update:
there is an update in facebook oauth and it is mentioned that all applications need to be updated to the latest version of oauth.
So that is the possible cause for your problem.
It outlines a plan requiring all sites and apps to migrate to OAuth 2.0, process the signed_request parameter, and obtain an SSL certificate by October 1.
check the link below:
http://developers.facebook.com/blog/post/497/
Thanks!
I found the solution: Omniauth works perfectly fine with Rails 2.3 and there is even a demo app on how to integrate it with Authlogic.
A popular one would be Devise which plays well with Omniauth. I am not sure of the compatibilities with rails 2 though, maybe time to upgrade...
Any reason you can not use Koala? https://github.com/arsduo/koala

Resources