Providing attributes from CAS

Stein, Eric steine at locustec.com
Tue Apr 9 15:23:12 EDT 2013


I set up all the configuration as detailed in the documents Benjamin referenced. When I log in from a web browser, no errors are logged but I'm still not seeing the username in the request/session headers. When I try to run aacli, there's still nothing in the log, but on the console I'm seeing the stack trace below. I'm not really sure why aacli would need ServletRequest. Does anybody know what might be going on?



Thanks,

Eric Stein



attribute-resolver.xml:

<resolver:AttributeDefinition xsi:type="ad:Simple" id="uid" sourceAttributeID="my_user">

     <resolver:Dependency ref="ATTRIBUTE_DATA_CONNECTOR" />

</resolver:AttributeDefinition>

<resolver:DataConnector xsi:type="RelationalDatabase"

                        xmlns="urn:mace:shibboleth:2.0:resolver:dc"

                        id="ATTRIBUTE_DATA_CONNECTOR"

                        queryUsesStoredProcedure="false"

                        noResultIsError="true">

    <ApplicationManagedConnection jdbcDriver="net.sourceforge.jtds.jdbc.Driver"

                                  jdbcURL="jdbc:jtds:sqlserver://my_database_server:1433/my_database"

                                 jdbcUserName="db_username"

                                 jdbcPassword="db_password" />

    <QueryTemplate>

        <![CDATA[

            SELECT my_user FROM my_user_table WHERE my_user='$requestContext.principalName'

        ]]>

    </QueryTemplate>

</resolver:DataConnector>





C:\Users\steine\Desktop>c:\shibboleth-2.3.8\bin\aacli.bat --principal steine

Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'shibboleth.HandlerManager': Initialization of bean failed; nested exception is java.lang.NoClassDefFoundError: javax/servlet/ServletRequest

        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:480)

        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)

        at java.security.AccessController.doPrivileged(Native Method)

        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)

        at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)

        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)

        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)

        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)

        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)

        at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:429)

        at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:728)

        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:380)

        at edu.internet2.middleware.shibboleth.common.attribute.AttributeAuthorityCLI.loadConfigurations(AttributeAuthorityCLI.java:206)

        at edu.internet2.middleware.shibboleth.common.attribute.AttributeAuthorityCLI.main(AttributeAuthorityCLI.java:95)

Caused by: java.lang.NoClassDefFoundError: javax/servlet/ServletRequest

        at java.lang.Class.getDeclaredMethods0(Native Method)

        at java.lang.Class.privateGetDeclaredMethods(Unknown Source)

        at java.lang.Class.privateGetPublicMethods(Unknown Source)

        at java.lang.Class.getMethods(Unknown Source)

        at java.beans.Introspector.getPublicDeclaredMethods(Unknown Source)

        at java.beans.Introspector.getTargetMethodInfo(Unknown Source)

        at java.beans.Introspector.getBeanInfo(Unknown Source)

        at java.beans.Introspector.getBeanInfo(Unknown Source)

        at org.springframework.beans.CachedIntrospectionResults.<init>(CachedIntrospectionResults.java:220)

        at org.springframework.beans.CachedIntrospectionResults.forClass(CachedIntrospectionResults.java:144)

        at org.springframework.beans.BeanWrapperImpl.getCachedIntrospectionResults(BeanWrapperImpl.java:252)

        at org.springframework.beans.BeanWrapperImpl.getPropertyDescriptorInternal(BeanWrapperImpl.java:282)

        at org.springframework.beans.BeanWrapperImpl.isWritableProperty(BeanWrapperImpl.java:333)

        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1247)

        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1010)

        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:472)

        ... 13 more

Caused by: java.lang.ClassNotFoundException: javax.servlet.ServletRequest

        at java.net.URLClassLoader$1.run(Unknown Source)

        at java.security.AccessController.doPrivileged(Native Method)

        at java.net.URLClassLoader.findClass(Unknown Source)

        at java.lang.ClassLoader.loadClass(Unknown Source)

        at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)

        at java.lang.ClassLoader.loadClass(Unknown Source)

        ... 29 more





-----Original Message-----
From: users-bounces at shibboleth.net [mailto:users-bounces at shibboleth.net] On Behalf Of Mosior, Benjamin
Sent: Tuesday, April 09, 2013 8:40 AM
To: Shib Users
Subject: RE: Providing attributes from CAS



Eric,



Take a look at the CAS documentation on the topic: https://wiki.jasig.org/display/CASUM/Shibboleth-CAS+Integration



The LoginHandler stanza that is added to the IdP's handler.xml facilitates the transfer of the CAS username to the Shibboleth IdP via the RemoteUser authentication method. The IdP then has the CAS-returned username. Yay.



Next, the IdP needs to use that username to look up attributes. This is where the ResolverRDBMSDataConnector you mention below comes into play. You'll essentially have to form an SQL query such as: SELECT * FROM PEOPLE WHERE userid='$requestContext.principalName' (an example from the page you linked below). That $requestContext.principalName is the username CAS passed to Shibboleth.



The next step from there would be to define which attributes to resolve and how/when to release them. You'll want to follow the basic flow of this page: https://wiki.shibboleth.net/confluence/display/SHIB2/IdPAddAttribute



Benjamin Mosior



-----Original Message-----

From: users-bounces at shibboleth.net<mailto:users-bounces at shibboleth.net> [mailto:users-bounces at shibboleth.net]<mailto:[mailto:users-bounces at shibboleth.net]> On Behalf Of Stein, Eric

Sent: Tuesday, April 09, 2013 8:16 AM

To: Shib Users

Subject: RE: Providing attributes from CAS



I did find https://wiki.shibboleth.net/confluence/display/SHIB2/ResolverRDBMSDataConnector, which looks like what I should be using for all the other attributes. I'm still really not clear on how to get access to the username. How do I take it from the authentication step?



Thanks,

Eric





--

To unsubscribe from this list send an email to users-unsubscribe at shibboleth.net<mailto:users-unsubscribe at shibboleth.net>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://shibboleth.net/pipermail/users/attachments/20130409/3ecdadeb/attachment-0001.html 


More information about the users mailing list