Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

authentication to support LDAP or database

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a requirement that few users login through LDAP and few users are Login through database(Native),for this i developed Login page that username(j_username),password(j_password) and Login Type(type) fields.If iam select the Login type as LDAP and then press submit it is working fine,if i am select Login type as Database then press Submit it is first authenticated with LDAP and then it is going to database authentication irrespective of Login type as Native it is going to LDAP authentication.Please help me.
 
Bartender
Posts: 2292
3
Eclipse IDE Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Howdy, Srinivas. Welcome to JavaRanch!

Champ, I'd kindly like to ask you to TellTheDetails. How's your environment? What's your server? Tomcat? How are you doing to switch between the types of authentication? How are your configuration files?
 
Srinivas Akshinthala
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Roberto
My Requirement is to authenticate the user either by using LDAP Or Native(Database),This is for when the LDAP Server is down the user can login through Native.(Some times the LDAP Server may be in down state).

My Environment is Struts,ApachedirectoryServer,Tomcat Server.

My Configuration in tomcat is:
In tomcat server.xml i replace the realm tag with the following code

I am attaching my Login jsp and My WebApplication Application web.xml
My Login jsp is:

My Application web.xml is:





Whenever Iam select LoginType as LDAP and click on Login button it is going to j_security_check of server(tomcat) it is fine but when we select LoginType as Native and Click On Login button then it is first going to j_security_check of server and then it is going to my /Dummy.do action irrespective of my selected Login Type.

Please help me.
 
Everybody's invited. Even this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic