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

The Archive Base Latest Questions

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

I am implementing FORM based authentication with j_security_check and I am stuck with the

  • 0

I am implementing FORM based authentication with j_security_check and
I am stuck with the following problem now:

Ok here are my config files:
web.xml:

<security-constraint>
<display-name>Efood Security</display-name>
<web-resource-collection>
  <web-resource-name>Secured Area</web-resource-name>
  <url-pattern>/checkout.jspx</url-pattern>
  <url-pattern>/checkout</url-pattern>
</web-resource-collection>
<auth-constraint>
  <role-name>friend</role-name>
</auth-constraint>
</security-constraint>

<login-config>
<auth-method>FORM</auth-method>
<realm-name>Secured eFood Area</realm-name>
<form-login-config>
  <form-login-page>/login.jspx</form-login-page>
  <form-error-page>/error.jspx</form-error-page>
</form-login-config>
</login-config>
<security-role>
  <role-name>10001</role-name>
</security-role>
<error-page>
  <error-code>403</error-code>
  <location>/403.jspx</location>
</error-page>

in server.xml

 <GlobalNamingResources>
 ....
 <Resource driverClassName="org.apache.derby.jdbc.ClientDriver"
 factory="org.apache.tomcat.jdbc.pool.DataSourceFactory" name="jdbc/CSE"
 password="secret" type="javax.sql.DataSource"
 url = "jdbc:derby://hostname:port/DB" username="student" />
 </GlobalNamingResources>
 ....
 <Realm className="org.apache.catalina.realm.LockOutRealm">
 <Realm  className = "org.apache.catalina.realm.DataSourceRealm" 
                driverName="org.apache.derby.jdbc.ClientDriver"
                debug="99"
                dataSourceName = "jdbc/DB" userTable = "users"
                userNameCol = "login" userCredCol="password"
                userRoleTable = "users" roleNameCol = "login" />

  </Realm>

in context.xml

 <ResourceLink type="javax.sql.DataSource" name="jdbc/DB" global="jdbc/DB"/>

So my problem is that I get 403 page when I enter correct credentials.
If I enter wrong username and password I am redirected to error.jsp,
which means that it checks the DB, however, I don’t know what the problem is.

Anyone had any familiar issues with authentication through DB?

Also, I am not sure how to do the secrity-role tag with role-names, because the given table only has username and password.

Thanks in advance!

  • 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-27T05:07:16+00:00Added an answer on May 27, 2026 at 5:07 am

    If you don’t have authorization roles, use

    <auth-constraint>
        <role-name>*</role-name> 
    </auth-constraint>
    

    and remove the <security-role>.

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

Sidebar

Related Questions

Here's my situation: I want stuff under mysite/customer/* to require form-based authentication before access
I'm implementing a form based on Ryan Bate's [always excellent] Railscast, #52, Update Through
I have a web project using asp.net mvc3. Now clients ask for a security
I'm developing a web application based on Hibernate, Spring and Wicket. Until now I
I am tasked with implementing an xml editor based on Win32 as a frontend
I'm looking at implementing some form of anonymous user system in Rails. I need
I am implementing an HTML form with some checkbox input elements, and I want
I am implementing a custom dialog to form an about screen with a simple
I'm implementing a website with a CAPTCHA on the registration form; my first. I've
My form doesn't have a title bar, so I am implementing the code to

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.