dcsimg
authenticate()
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   thomas_tran
Posted On:   Wednesday, May 29, 2002 11:13 AM

Anyone help me please <%@ page import="javax.naming.*,javax.naming.directory.*,java.util.*;"%> <% Hashtable htven = new Hashtable(); htven.put(Context.INITIAL_CONTEXT_FACTORY,"com.sun.jndi.ldap.LdapCtxFactory"); htven.put(Context.PROVIDER_URL,"ldap://159.212.250.155:389/o=ihc"); htven.put(Context.SECURITY_AUTHENTICATION, "simple"); htven.put(Context.SECURITY_PRINCIPAL, "appl=LAB Web,ou=application, o=ihc"); htven.put(Context.SECURITY_CREDENTIALS, "hardpwd4"); try { //Creat intial context DirContext ctx = new InitialDirContext(htven); //re   More>>

Anyone help me please

			
<%@ page import="javax.naming.*,javax.naming.directory.*,java.util.*;"%>


<%

Hashtable htven = new Hashtable();

htven.put(Context.INITIAL_CONTEXT_FACTORY,"com.sun.jndi.ldap.LdapCtxFactory");
htven.put(Context.PROVIDER_URL,"ldap://159.212.250.155:389/o=ihc");
htven.put(Context.SECURITY_AUTHENTICATION, "simple");
htven.put(Context.SECURITY_PRINCIPAL, "appl=LAB Web,ou=application, o=ihc");
htven.put(Context.SECURITY_CREDENTIALS, "hardpwd4");



try
{

//Creat intial context
DirContext ctx = new InitialDirContext(htven);

//retrieve the username and password from request
String userName=request.getParameter("username");
String passWord=request.getParameter("password");

//Authenticate the users
boolean isAuthenticated= authenticate(userName,passWord);
if(isAuthenticated){
session=request.getSession(true);

//Convert the boolean to a Boolean
Boolean booleanIsAuthenticated = new Boolean( isAuthenticated);
session.putValue(Context.SECURITY_AUTHENTICATION,booleanIsAuthenticated);
// response.sendRedirect(requestedPage);
}
// }



ctx.close();

}

catch(NamingException e){

e.printStackTrace();
}



%>

This is errors:
org.apache.jasper.JasperException: Unable to compile class for JSP/usr/local/tomcat/jakarta-tomcat/work/localhost_8080%2Fenterprise%2Fis%2Flis/_0002fjndi_0002ejspjndi_jsp_14.java:85: Method authenticate(java.lang.String, java.lang.String) not found in class _0002fjndi_0002ejspjndi_jsp_14.
boolean isAuthenticated= authenticate(userName,passWord);
^
Note: /usr/local/tomcat/jakarta-tomcat/work/localhost_8080%2Fenterprise%2Fis%2Flis/_0002fjndi_0002ejspjndi_jsp_14.java uses or overrides a deprecated API. Recompile with "-deprecation" for details.
1 error, 1 warning

   <<Less
About | Sitemap | Contact