You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Gustavo Henrique <gu...@gmail.com> on 2010/11/01 20:03:53 UTC

Send an object to page

hi!

what better way to send an object to webpage?
I'm sending in constructor but the URI is not friendly.

thanks!

Re: Send an object to page

Posted by James Carman <ja...@carmanconsulting.com>.
On Thu, Nov 4, 2010 at 12:22 AM, Jeremy Thomerson
<je...@wickettraining.com> wrote:
> That part of the thread is what I was replying to - that it was then
> insecure because the DB ID is in the URL.  This is not a standard way of
> doing most links in Wicket - because of the security leak....
>

They wanted pretty URLs, but wanted to pass a specific object to the
page.  Wouldn't you need to use a bookmarkable URL to make it
"pretty"?

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Send an object to page

Posted by James Carman <ja...@carmanconsulting.com>.
On Thu, Nov 4, 2010 at 4:47 AM, Wilhelmsen Tor Iver <To...@arrive.no> wrote:
>
> You could maybe even implement that as a custom URLCodingStrategy or whatever new mechanism in 1.5 is better suited for the task. The simplest case would be just to have a singleton mapper with two methods, one for adding (returning token for value) and one for removing (returning value for token) where the token is just a sequence number. To make it more complicated the service could be registered as a JNDI resource or a OSGi bundle... :)
>

So what if the user just starts guessing tokens, since they're sequential?

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


SV: Send an object to page

Posted by Wilhelmsen Tor Iver <To...@arrive.no>.
> That part of the thread is what I was replying to - that it was then
> insecure because the DB ID is in the URL.  This is not a standard way of
> doing most links in Wicket - because of the security leak....

A workaround is to use one-time keys (tokens) in a map that you set for the URL and then destructively get in the constructor. What the token points to (the "real" id) is kept server-side. This will be non-RESTful though since the URL will not represent the resource any longer once it has been used.

You could maybe even implement that as a custom URLCodingStrategy or whatever new mechanism in 1.5 is better suited for the task. The simplest case would be just to have a singleton mapper with two methods, one for adding (returning token for value) and one for removing (returning value for token) where the token is just a sequence number. To make it more complicated the service could be registered as a JNDI resource or a OSGi bundle... :)

- Tor Iver

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Send an object to page

Posted by Jeremy Thomerson <je...@wickettraining.com>.
On Wed, Nov 3, 2010 at 7:39 PM, Peter Ertl <pe...@gmx.org> wrote:

> Also, if the userID is the id of the currently logged in user why not just
> store it in your wicket session when logging on to make it inaccessible for
> the client and prevent spoof altogether?


Obviously this is more secure.  And also not even necessary - the ID can be
directly in the link's model, so you can have dozens of links on the page,
all to edit different users, rather than having a single ID in the session.
 That's the whole premise Wicket is built around.

But, you missed this part of the thread apparently:

On Mon, Nov 1, 2010 at 5:09 PM, James Carman <ja...@carmanconsulting.com>
 wrote:

> You could pass the "id" of the object (if possible) as a
> PageParameter.  You can then use a bookmarkable URL for your page.
> You'll have to lookup the object from the db, though.  Again, this is
> only possible if the object is an "entity."


That part of the thread is what I was replying to - that it was then
insecure because the DB ID is in the URL.  This is not a standard way of
doing most links in Wicket - because of the security leak....

-- 
Jeremy Thomerson
http://wickettraining.com
*Need a CMS for Wicket?  Use Brix! http://brixcms.org*

Re: Send an object to page

Posted by Peter Ertl <pe...@gmx.org>.
> That's one more reason why I use UUID's for my object ids.  They're
> harder to spoof.


Security by obscurity :-) 

Checking the URL is not an option ... any web app claiming to be secure must do that no what what the surrogate database key looks like *imho*

Also, if the userID is the id of the currently logged in user why not just store it in your wicket session when logging on to make it inaccessible for the client and prevent spoof altogether?

Am 02.11.2010 um 05:29 schrieb James Carman:

> On Mon, Nov 1, 2010 at 11:30 PM, Jeremy Thomerson
> <je...@wickettraining.com> wrote:
>>> 
>> And, of course, it opens you up to doing more security checks.... i.e., you
>> have editUserProfile.html?userID=123 - now you have to check that the signed
>> in person is allowed to edit whatever user they are trying to edit (since
>> they can twiddle the URL).
>> 
> 
> That's one more reason why I use UUID's for my object ids.  They're
> harder to spoof.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Send an object to page

Posted by James Carman <ja...@carmanconsulting.com>.
On Mon, Nov 1, 2010 at 11:30 PM, Jeremy Thomerson
<je...@wickettraining.com> wrote:
>>
> And, of course, it opens you up to doing more security checks.... i.e., you
> have editUserProfile.html?userID=123 - now you have to check that the signed
> in person is allowed to edit whatever user they are trying to edit (since
> they can twiddle the URL).
>

That's one more reason why I use UUID's for my object ids.  They're
harder to spoof.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Send an object to page

Posted by Jeremy Thomerson <je...@wickettraining.com>.
On Mon, Nov 1, 2010 at 5:09 PM, James Carman <ja...@carmanconsulting.com>wrote:

> You could pass the "id" of the object (if possible) as a
> PageParameter.  You can then use a bookmarkable URL for your page.
> You'll have to lookup the object from the db, though.  Again, this is
> only possible if the object is an "entity."
>
>
And, of course, it opens you up to doing more security checks.... i.e., you
have editUserProfile.html?userID=123 - now you have to check that the signed
in person is allowed to edit whatever user they are trying to edit (since
they can twiddle the URL).


-- 
Jeremy Thomerson
http://wickettraining.com
*Need a CMS for Wicket?  Use Brix! http://brixcms.org*

Re: Send an object to page

Posted by James Carman <ja...@carmanconsulting.com>.
You could pass the "id" of the object (if possible) as a
PageParameter.  You can then use a bookmarkable URL for your page.
You'll have to lookup the object from the db, though.  Again, this is
only possible if the object is an "entity."

On Mon, Nov 1, 2010 at 6:04 PM, andrea del bene <an...@libero.it> wrote:
> Passing objects to webpage via constructor is fine if you feel comfortable
> with it. If you wanna change URI you should take a look at  Wicket URL
> Coding strategies:
> https://cwiki.apache.org/WICKET/url-coding-strategies.html. Using coding
> strategies you should be able to change URL as you prefer, but I've never
> used this technique so I can't be more precise.
>
> Bye.
>>
>> hi!
>>
>> what better way to send an object to webpage?
>> I'm sending in constructor but the URI is not friendly.
>>
>> thanks!
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Send an object to page

Posted by andrea del bene <an...@libero.it>.
Passing objects to webpage via constructor is fine if you feel 
comfortable with it. If you wanna change URI you should take a look at  
Wicket URL Coding strategies: 
https://cwiki.apache.org/WICKET/url-coding-strategies.html. Using coding 
strategies you should be able to change URL as you prefer, but I've 
never used this technique so I can't be more precise.

Bye.
> hi!
>
> what better way to send an object to webpage?
> I'm sending in constructor but the URI is not friendly.
>
> thanks!
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org