954,574 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Java Servlet Security Question

I have a passkey to authenticate access to a web service in the code of one of my java serlvets. How easy is it for someone to view the code for my java servlet when it is on my web server? It would pose a security risk to my entire web application if someone was able to find out my passkey. Should i try to find some way around putting this information in my servlet? Does it matter which folder on my web server I put the servlet?

kinger29
Light Poster
36 posts since Mar 2008
Reputation Points: 11
Solved Threads: 2
 
__avd
Posting Genius (adatapost)
Moderator
8,648 posts since Oct 2008
Reputation Points: 2,136
Solved Threads: 1,241
 

What do you mean you store your password in the servlet? Is it a field of the class or directly typed in the source code?

If so then maybe your not doing it the way it meant to be...
Use a doPost (not doGet )method do get the username and pass from a form that's located on the site. Save these in static class fields, or better, in a database!

The most secure way i can think of is getting your password and username from a database ant compare them with the form's input parameters.

If you don't know what is doPost, html form then i suggest googl'ing. Then tell me about your results.
Ps: hope you know about databases too.

Alex_
Junior Poster
175 posts since Jun 2008
Reputation Points: 10
Solved Threads: 3
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You