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 7945085
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T00:45:01+00:00 2026-06-04T00:45:01+00:00

I use the jQuery Validation plugin for validation using remote: /valid_password.json to check on

  • 0

I use the jQuery Validation plugin for validation using remote: "/valid_password.json" to check on the server if the submitted password is the right one. The problem is that on the server the password is encrypted (using Authlogic), so when I compare the password parameter with the stored password, they are not the same. How can I validate the password using the JQuery Validation plugin?

Here is the code in the controller:

def valid_password
    username = params[:user_session][:username]
    password = params[:user_session][:password]
    @user = User.find_by_username(username)
    if @user.password == password
      @password_ok = true
    end
    respond_to do |format|
      format.json { render :json => @password_ok ? "true" : "false"}
    end
end

Edit: After searching and reading, I have tried this: (still with no success)

def valid_password
    username = params[:username]
    password = params[:user_session][:password]
    @user = User.find_by_username(username)
    puts "TEST" + @user.crypted_password
    @password = Authlogic::CryptoProviders::Sha512.encrypt(password)
    puts "TEST"  + @password
    if @password == @user.crypted_password
      @password_ok = true
    end

    respond_to do |format|
      format.json { render :json => @password_ok ? "true" : "false"}
    end
end

The two puts methods give different results. I think I should be using the stored password_salt to get the encryption right, but I don’t know how. Originally I used the wrong parameter for “username”, but now that is fixed.

  • 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-06-04T00:45:03+00:00Added an answer on June 4, 2026 at 12:45 am

    Now it works!

    I had to add the password_salt to the password before encrypting:

    def valid_password
      username = params[:username]
      password = params[:user_session][:password]
      @user = User.find_by_username(username)
      password = "#{password}#{@user.password_salt}"
      @password = Authlogic::CryptoProviders::Sha512.encrypt(password)
      if @password == @user.crypted_password
        @password_ok = true
      end
    
      respond_to do |format|
        format.json { render :json => @password_ok ? "true" : "false"}
      end
    end
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Im trying to use the remote feature in the JQuery Validation Plugin to check
Using jQuery validation plugin - http://docs.jquery.com/Plugins/Validation Wanting to use the remote method on a
I am using jquery validation plugin to validate my form. I have one field
hope you can help me on this one, I'm currently using this: jQuery plugin:validation
I am using this jQuery form validation plugin: http://docs.jquery.com/Plugins/Validation/Methods I am trying to use
I'm using jQuery validation plugin to validate a form. when one thing is selected
I am using the JQuery Validation plugin to handle form validation. The problem I
I am using jquery form validation plugin http://bassistance.de/jquery-plugins/jquery-plugin-validation/ If form is invalid my server
I'm using the jQuery validation plugin and I want make use of a custom
I am using the JQuery Validation Plugin. I got the remote function working with

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.