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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T12:45:10+00:00 2026-06-18T12:45:10+00:00

My remember-me bean definition looks like this, and works fine <security:remember-me data-source-ref=dataSource user-service-ref=userService/> However

  • 0

My remember-me bean definition looks like this, and works fine

<security:remember-me  data-source-ref="dataSource" user-service-ref="userService"/>

However the first time a user registers, and I want to programmatically log them in and perform a remember-me. I do not know how to access the remember-me service. I can do this

UsernamePasswordAuthenticationToken auth = 
    new UsernamePasswordAuthenticationToken(user, "", authorities);
SecurityContextHolder.getContext().setAuthentication(auth);

HttpServletRequestWrapper wrapper = new HttpServletRequestWrapper(request) {
    @Override public String getParameter(String name) { return "true"; }            
};

But how to access the remember-me service like below, as I am using the default spring implementation and not my own bean ?

getRememberMeServices().loginSuccess(wrapper, response, auth);

from here

EDIT
I have changed my bean definition to look like this

<security:remember-me services-alias="rememberMeService" data-source-ref="dataSource" user-service-ref="userService"/>

But intellij is still coming back with an error when I try to inject like this :

@Resource(name = "rememberMeService")
private RememberMeServices rememberMeService;
  • 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-18T12:45:11+00:00Added an answer on June 18, 2026 at 12:45 pm

    You can use the services-alias attribute of the remember-me namespace element to set a bean alias for the RememberMeServices. You can then inject that reference into other beans you create yourself.

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

Sidebar

Related Questions

I am attempting to enable remember me functionality using spring security <bean id=userService class=mypath.service.UserDetailsServiceImpl
Using Spring, I've declared a RememberMe bean in my XML: <security:http authentication-manager-ref=authenticationManager> ..... <security:remember-me
i remember a while ago i used a method like this to print out
I am developing my first application in spring security. My applicationContext-security.xml file looks like
I remember seen some code xaml where can get the first element (like an
Remember, this is using python. Well, I was fiddling around with an app I
My elastic search setup is something like this :analyzer => { :default => {
If I keep remember-me element in security.xml file and startup a server then I
I'm using Spring Security 3.0.5 for authentication and I'm using remember-me as well. Currently,
I remember coming across the solution for this problem.. There is a special term

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.