0

I use tomcat 7 and I want to use http basic authentication. If you want to access a site, you are forced to type in a username and password.

my url: http://localhost:8080/project

But i want to provide the username and password in the url. I want to skip the window where I have to write username and password. Like it is described http://en.wikipedia.org/wiki/Basic_access_authentication

wiki example: https://username:[email protected]/path

In my case it should be something like the following:

 username = admin
 password = mypw1#

https://admin:mypw1#@localhost:8080/project

or

http://admin:mypw1#@localhost:8080/project

But it is not working. Neither in Firefox nor in Chrome. Browser can't even find the site. If I just use localhost:8080/project the site is loaded and I am prompted to login with username and password.

2
  • Is Tomcat configured for SSL ? Commented Jul 19, 2013 at 11:43
  • It's a default installation. No changes to server.xml. Commented Jul 19, 2013 at 11:53

2 Answers 2

1

Browser uses # for the anchor. You have to escape the hash or use HTTP auth header.

Sign up to request clarification or add additional context in comments.

Comments

1

Try URL encoding the password:

http://admin:mypw1%23@localhost:8080/project

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.