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

  • Home
  • SEARCH
  • 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 7651237
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T11:27:16+00:00 2026-05-31T11:27:16+00:00

I wanted to use MongoDB in my Grails application and also Spring Security. I

  • 0

I wanted to use MongoDB in my Grails application and also Spring Security. I generated both User and Role classes with the s2-quickstart command. I added an id property to all my classes of type ObjectId as it says in many blog articles.

It does work, but one method bothers me a little:

    // SecUser.groovy (generated by s2-quickstart)
def beforeUpdate() {
    if (this.isDirty('password')) {
        encodePassword()
    }
}

The method isDirty() seems to be unavailable in a MongoDB environment. It works fine using Hibernate. This is a bug filed under http://jira.grails.org/browse/GPMONGODB-114

Is there any way to get around this method? As far as I understand, it checks if the password was modified and then encodes it again.

Wouldn’t it be possible to do this manually? For example, if I have a User profile page which has the password field included, I just encode it again on save?

I’d really like to use both Spring Security and MongoDB together and I’m sure this method won’t stop me. 😉

  • 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-31T11:27:18+00:00Added an answer on May 31, 2026 at 11:27 am

    I see no reason why you can’t create your own UserDetailsService which loads the hashed password from Mongo, then use a PasswordEncoder in your AuthenitcationManager. This will tell Spring to hash the password entered by the user before comparing it to the value you retrieved from mongo.

    I can’t comment on the Grails aspect but we are using Spring security and hashed passwords with Mongo. We actually have a custom password encoder that uses an iterative hash/salt so I’m sure what you want is possible 🙂

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

Sidebar

Related Questions

I wanted to use the currentStateChange event in my application but whatever code being
I wanted to use the UiImagePicker to record a video then let the user
I wanted to use JET (Java Emitter Templates) in my Netbeans projects, but had
I wanted to use groovy for a little ftp script and found this post
I wanted to use monotouch, but unfortunately I don't have $400 to spend. So
I wanted to use the custom field for wordpress to have a different header
I wanted to use a python equivalent to piping some shell commands in perl.
I wanted to use a particle system in a kinect project with c sharp
I wanted to use a hashtable as set of some objects for a graphic
I wanted to use SELECT ... WHERE LIKE query against my file's path (VARCHAR)

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.