Results 1 to 2 of 2

Thread: get username and password on server side using basic authentication

  1. #1
    Join Date
    Jan 2009
    Posts
    2

    Default get username and password on server side using basic authentication

    Hello,


    I'd like to know how can I get user details on server side web application. I use basic authentication, and the client sends azt username and password in every requests, and they are compared with the tomcat-users. It is working fine, but I'd like to get details and use them in my simple echo service. For example: Login details: usr: "username" pwd: "password", (on the client side) String response = echoService.echo("SomeWord") . And the response would be some like this: response = ""Echo: SomeWord User: username Password: passwod".
    I hpe I could explain what I'd like.

    Thanks,
    Fermo

  2. #2
    Join Date
    Jun 2007
    Location
    Minsk, Belarus
    Posts
    217

    Default

    If you use container-based security then request, then use request.getRemoteUser or request.getUserPrincipal and read additional info from database manually.

    If you also use spring security consider pre-authentication functionality:
    http://static.springframework.org/sp...l/preauth.html

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •