Win a copy of Java EE 8 High Performance this week in the Java/Jakarta EE forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Log-in "directly" when using form authentication  RSS feed

Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm using form authentication in a toy project of mine. This works fine - you try to access a protected page, the login form is shown, you log-in and move on. There's a little variation I'm thinking of, and was wondering if it's possible: I want a little login form to be placed at the top of the home page, so you can login directly. Just user and password fields, and a submit button. But logging in directly is not possible with form authentication, AFAIK. The only workaround I could think of is have the submit button run some JS instead of posting the form: have some hidden iframe access a protected resource, let the JS place the user and password in the right fields, submit and when done, reload the top page. Does this make any sense? Is there a better way?

BTW, this is possibly a bad usability choice, but I'm still interested in the technical solution. The project is educational...
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!