tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Aditya <adi...@mighty.grot.org>
Subject programmatic way to invoke authentication?
Date Mon, 01 Apr 2002 06:35:28 GMT
Is there a programmatic way to force a user to authenticate without using a
security-constraint in web.xml? It seems like I should be able to do something
like:

  String myremotename = request.getRemoteUser();
  if (myremotename == null){
    LoginConfig myconfig = new LoginConfig();
    myconfig.setAuthMethod("FORM");
    myconfig.setErrorPage("/admin/error.html");
    myconfig.setLoginPage("/admin/Login");
    myconfig.setRealmName("My Login");
    if (authenticate(request, response, myconfig)){
      return;
    }
  } else {
    out.println("username: " + myremotename + "<br>");
  }

but needless to say, that doesn't work -- I've been through the javadocs and
source and can't figure it out. hints?

Thanks,
Adi

 

--
To unsubscribe:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands: <mailto:tomcat-user-help@jakarta.apache.org>
Troubles with the list: <mailto:tomcat-user-owner@jakarta.apache.org>


Mime
View raw message