Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6054161
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T08:07:19+00:00 2026-05-23T08:07:19+00:00

Using the rails-ckeditor and I’m getting a 401 exception anytime I try to upload

  • 0

Using the rails-ckeditor and I’m getting a 401 exception anytime I try to upload an image using the “Browse Server” and then “Upload” buttons. I’m securing my site right now using simple basic authentication as such

class ApplicationController < ActionController::Base
  protect_from_forgery

  before_filter :authenticate

  def logged_in?
    # cookies[:auth].present?
  end

  def authenticate
    # unless logged_in?
      authenticate_or_request_with_http_basic do |login, password|
        if(login == "user1" && password == "password")
          cookies.permanent.signed[:auth] = login
        end
      end
    # end
  end

  def current_church
    @current_church ||= Church.first
  end

end

If I disable basic authentication everything works fine. Is there a remedy for this?

Thanks -wg

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T08:07:20+00:00Added an answer on May 23, 2026 at 8:07 am

    Problem is with using SWFUpload (flash) to send up cookies.

    This link got me looking in the right direction:
    http://ruby-on-rails-development.co.uk/2011/05/23/securing-ckeditor-file-management

    The solution is to follow the directiosn from that article with the following additions:

    1. In the flash_session_cookie_middleware.rb file add

      env[‘HTTP_COOKIE’] = [ ‘auth’, params[‘auth’] ].join(‘=’).freeze

    2. In the base_helper.rb file (under /app/helpers/ckeditor) add the following:

      options[‘auth’] = Rack::Utils.escape(cookies[:auth])

    The latest source for this gem handles session based tokens and the authenticity token already. This simple hack is only needed if your going with a cookie based approach to managing your authentication ticket.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using rails 3.1rc4 with paperclip and i cannot upload any image file
Using Rails 2, I try to separate different, dynamic image sizes trough another Model
I'm new to rails and I recently discovered rails_admin. I added CKEditor using the
(Using Rails 2.3.5 on an internal work server with no choice of versions, and
I am using ckeditor for rails 3 and I have it set up already
Using Rails v2.1, lets say you have an action for a controller that is
When using Rails date_select with :prompt => true I see some very strange behavior
I'm using rails, but doing all my Javascript unobtrusively using jQuery in application.js .
I am using Rails 2.3 and I decided to provide support for JSONP. Created
I'm using rails 2.3.4 When I execute rake db:test:prepare the id field created is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.