I'm using JAVA and Wicket on JBOSS 5. I need to change JSESSIONID cookie value to get the same Session used in another client (setting the other client's JSESSIONID). I need that to authenticate the other client that has no keyboard). What is the best way?
相关问题
- Delete Messages from a Topic in Apache Kafka
- Jackson Deserialization not calling deserialize on
- How to maintain order of key-value in DataFrame sa
- StackExchange API - Deserialize Date in JSON Respo
- Difference between Types.INTEGER and Types.NULL in
I recommend you to implement some kind of auto-login feature in your application. There are a number of possibilities for that (Client Certificate, or Single Sign-On with some other AA provider, even domain cookie).
If you are trying to log in with another application, your options are HTTP Basic Authentication, Client Certificate, or simply posting the username/password to your login page (this one is not the safest, though).
I prefer the Client Certificate, since that is the safest solution.
If you really want to hack the
JSESSIONID
(which I don't recommend), you can do the following way:HttpServletRequest
(a new instance of this class must be passed to thechain.doFilter()
) (let's call itRequestWrapper
)RequestWrapper
override thegetSession(boolean)
methodIn the
getSession(booelan)
implementation you have togetSession()
The key moment is: How do you identify your non-keyboard user? If you can't do it safely (from the current information you provided I cannot see it), it is a security hole.