attribute resolver question

Cantor, Scott cantor.2 at osu.edu
Tue Jul 18 20:09:37 EDT 2017


On 7/18/17, 5:03 PM, "users on behalf of Sean Singh" <users-bounces at shibboleth.net on behalf of sean.singh at rochester.edu> wrote:

> I'm trying to learn how that process works. As part of that learning process
> I was trying to follow the example in the documentation.

I don't know which example you're following, but the only script I can see there is one that describes a use case involving MFA and Duo, for example, which may be very different in nature. But your issue is simple, you already diagnosed it.

> I'm not a Java programmer

This isn't actually Java, it's Javascript (or theoretically Ruby, Python, etc.).

> but what I've found leads me to believe that
> "Java.type" is a Nashorn/Java 8 thing. I'm using Java 7... which is listed
> as supported. 

Supported but dead. But yes, all the examples use Nashorn.

> So I'm trying to figure out how to emulate that functionality to get this example to work.

Java.type is the Nashorn way to get hold of a class to create new objects or access class types. I'm not sure I have an example in my config, which uses Rhino, of accessing a Class object, which is the trick to doing what that line of script is doing (the type passed to the Subject.getPrincipals method). The Rhino docs somewhere should cover that syntax. Actual creation of objects is easy (you can just do new typename), but this isn't quite that.

-- Scott




More information about the users mailing list