accessing user principal in scripted attributes

Liam Hoekenga liamr at umich.edu
Sat Jun 13 15:48:29 EDT 2015


I tried those.

> requestContext is the simulation of the old V2 context and for that you
need
> to call requestContext.getPrincipalName().

uniqueValue = requestContext.getPrincipalName() + salt;

2015-06-12 09:38:44,913 - ERROR
[net.shibboleth.idp.profile.impl.ResolveAttributes:256] - Profile Action
ResolveAttributes: Error resolving attributes
net.shibboleth.idp.attribute.resolver.ResolutionException: Attribute
Definition 'umichPersonUniqueId': unable to execute script
at
net.shibboleth.idp.attribute.resolver.ad.impl.ScriptedAttributeDefinition.doAttributeDefinitionResolve(ScriptedAttributeDefinition.java:152)
Caused by: javax.script.ScriptException: TypeError: null has no such
function "getPrincipalName" in <eval> at line number 11
at
jdk.nashorn.api.scripting.NashornScriptEngine.throwAsScriptException(NashornScriptEngine.java:455)
Caused by: jdk.nashorn.internal.runtime.ECMAException: TypeError: null has
no such function "getPrincipalName"
at jdk.nashorn.internal.runtime.ECMAErrors.error(ECMAErrors.java:57)


> In V3 it's called resolutionContext and you call resolutionContext
.getPrincipal()

uniqueValue = resolutionContext.getPrincipal() + salt;

2015-06-12 09:54:14,998 - ERROR
[net.shibboleth.idp.profile.impl.ResolveAttributes:256] - Profile Action
ResolveAttributes: Error resolving attributes
net.shibboleth.idp.attribute.resolver.ResolutionException: Attribute
Definition 'umichPersonUniqueId': unable to execute script
at
net.shibboleth.idp.attribute.resolver.ad.impl.ScriptedAttributeDefinition.doAttributeDefinitionResolve(ScriptedAttributeDefinition.java:152)
Caused by: javax.script.ScriptException: TypeError: null has no such
function "getPrincipal" in <eval> at line number 11
at
jdk.nashorn.api.scripting.NashornScriptEngine.throwAsScriptException(NashornScriptEngine.java:455)
Caused by: jdk.nashorn.internal.runtime.ECMAException: TypeError: null has
no such function "getPrincipal"
at jdk.nashorn.internal.runtime.ECMAErrors.error(ECMAErrors.java:57)


Liam

On Sat, Jun 13, 2015 at 6:28 AM, Rod Widdowson <rdw at steadingsoftware.com>
wrote:

> It's always obvious when you see it......
>
> requestContext is the simulation of the old V2 context and for that you
> need
> to call requestContext.getPrincipalName().
>
> In V3 it's called resolutionContext and you call resolutionContext
> .getPrincipal()
>
> /Rod
>
> --
> To unsubscribe from this list send an email to
> users-unsubscribe at shibboleth.net
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://shibboleth.net/pipermail/users/attachments/20150613/583be8ca/attachment.html>


More information about the users mailing list