URL encoding the entity ID in Velocity

Wessel, Keith kwessel at illinois.edu
Wed Feb 3 14:33:22 EST 2016


Thanks, Scott. An excellent enhancement. I wondered exactly what the "custom" variable meant at the top in the comments.

I'm having some trouble getting it working. I've uncommented the block you mentioned in global.xml and set the key to urlEncoder, the value to java.net.URLEncoder. I restarted Jetty to re-read global.xml. But when I put $urlEncoder.encode("$entityID", "utf-8") in my login.vm, Velocity gives me back a literal string. Same for when I make it $custom.urlEncoder.encode("$entityID","utf-8").

What am I doing wrong?

Keith


-----Original Message-----
From: users [mailto:users-bounces at shibboleth.net] On Behalf Of Cantor, Scott
Sent: Wednesday, February 03, 2016 12:32 PM
To: Shib Users <users at shibboleth.net>
Subject: Re: URL encoding the entity ID in Velocity

On 2/3/16, 1:19 PM, "users on behalf of Wessel, Keith" <users-bounces at shibboleth.net on behalf of kwessel at illinois.edu> wrote:



>We could just make this a static page, but we'd ideally like to pass the entityID of the SP back to the discovery service. To do this, I'm thinking we'll ned to URL encode the entityID. Is there an easy way to do this in Velocity witouth changing the IDP source to pass another variable into Velocity to define a java.net.URLEncoder object?

See global.xml, shibboleth.CustomViewContext, you're free to expose any objects you want, they'll be passed into all views. Added in 3.2.

>Or is there another way to encode this?

Many I'm sure...

>Or can I perhaps just grab the URL-encoded entityID from the request object somehow?

Not anywhere obvious, there's no reason it would be lying around encoded.

-- Scott

-- 
To unsubscribe from this list send an email to users-unsubscribe at shibboleth.net


More information about the users mailing list