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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T20:20:19+00:00 2026-05-28T20:20:19+00:00

I have this Spring XML: <!– Configure the authentication –> <security:http auto-config=true use-expressions=true> <security:form-login

  • 0

I have this Spring XML:

    <!-- Configure the authentication  -->
    <security:http auto-config="true" use-expressions="true">
        <security:form-login login-page="/login"
                             authentication-failure-url="/login?error=true"
                             default-target-url="/index" />

        <security:logout invalidate-session="true"
                         logout-success-url="/login"
                         logout-url="/logout" />
    </security:http>

    <security:authentication-manager>
        <security:authentication-provider user-service-ref="testUDS" />
    </security:authentication-manager>

    <bean id="testUDS" class="net.safecycle.services.security.TestUserDetailService" />

My UserDetailsService implementation looks like this:

public class TestUserDetailService implements UserDetailsService {
    public UserDetails loadUserByUsername 
    (
        String username
    ) throws UsernameNotFoundException {
        System.out.println ("loadUserByUsername (" + username + ")");

        Collection<GrantedAuthority> authorities;
        authorities = new LinkedList<GrantedAuthority> ();
        authorities.add (new GrantedAuthorityImpl ("Admin"));

        UserDetails ud = new User (username, 
                                   "ca", 
                                   true, 
                                   true, 
                                   true, 
                                   true, 
                                   authorities);
        return ud;
    }
}

When I log in with any username and the password ‘ca’, I should see the print statement at the top of my loadUserByUsername, but I do not. What is most perplexing is that I have used this code in another project with no problem. Is there anything I am missing, a copy mistake I’m hoping?

  • 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-28T20:20:20+00:00Added an answer on May 28, 2026 at 8:20 pm

    Try to specify which resources are protected

    <security:intercept-url pattern="/**" access="isAuthenticated()"/>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string in XML format and I want to use this string
I have this Spring config: <bean id=boo class=com.x.TheClass/> The class TheClass implements TheInterface .
This is a Spring Security question. In my application, I have a User entity
We have this line in our Spring applicationContext.xml : <context:property-placeholder location=classpath*:*.properties /> But it's
I have 2 problems with spring my spring-security.xml When I have more than one
I've registered my spring security xml file in the web.xml. Now I have a
Ok, I have this spring hibernate xml configuration. <bean id=sessionFactory class=org.springframework.orm.hibernate3.LocalSessionFactoryBean> <property name=dataSource ref=dataSource
currently I'm creating proxy classes from interfaces with spring 3 xml config like this:
I have sitemesh with spring working, this is the configuration: decorator.xml <?xml version=1.0 encoding=UTF-8?>
I have a java application that use spring with a spring.xml file in the

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.