allowedAttributes not being stored

View: New views
9 Messages — Rating Filter:   Alert me  

allowedAttributes not being stored

by Robert Lewis :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Hi,

In my services management feature of cas3.2.1, inside my java code, say
inside CentralAuthenticationServiceImpl.java, I am not able to retrieve
the allowed attributes using registeredService.getAllowedAttributes().
So, I am trying to follow thru where this info is stored and retrieved.

In, add.jsp there is a submit action that submits the selected list in a
field, as follows.

<form:select path="allowedAttributes" items="${availableAttributes}"
multiple="true" />

and


<div class="actions">
                <button type="submit" class="primaryAction"
id="submit-wf_FormGardenDemonst" value="Save Changes"><spring:message
code="management.services.add.button.save" /></button> or <a
href="manage.html" style="color:#b00;"><spring:message
code="management.services.add.button.cancel" /></a>
        </div>


I don't know jsp, but it seems the allowed attributes are selected in
the view and submitted somewhere. I want the list of allowed attributes
to be stored by the serviceRegistryDao in the mysql database I have set
up. My services whitelist is currently being stored by
serviceRegistryDao, that part works. I can look in the table and I see
mostly everything looks correct, but there is binary stuff where the
allowed attributes list should be.

So, my question is: What code takes the allowed attributes "submit"
action and stores the selected list in the database? Is it in
JpaTransactionManager or the class I configured for attributeRepository?

Thanks,

Robert Lewis
_______________________________________________
Yale CAS mailing list
cas@...
http://tp.its.yale.edu/mailman/listinfo/cas

Re: allowedAttributes not being stored

by scott_battaglia :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Robert,

Its using JPA/Hibernate to do the storage.  Do you have the correct dialect set for Hibernate?  I can give it a try under MySql, I think my notebook has it, but probably not until later or tomorrow.

-Scott

-Scott Battaglia
PGP Public Key Id: 0x383733AA
LinkedIn: http://www.linkedin.com/in/scottbattaglia

On Thu, Jul 3, 2008 at 5:42 PM, Robert Lewis <r.lewis@...> wrote:

Hi,

In my services management feature of cas3.2.1, inside my java code, say
inside CentralAuthenticationServiceImpl.java, I am not able to retrieve
the allowed attributes using registeredService.getAllowedAttributes().
So, I am trying to follow thru where this info is stored and retrieved.

In, add.jsp there is a submit action that submits the selected list in a
field, as follows.

<form:select path="allowedAttributes" items="${availableAttributes}"
multiple="true" />

and


<div class="actions">
               <button type="submit" class="primaryAction"
id="submit-wf_FormGardenDemonst" value="Save Changes"><spring:message
code="management.services.add.button.save" /></button> or <a
href="manage.html" style="color:#b00;"><spring:message
code="management.services.add.button.cancel" /></a>
       </div>


I don't know jsp, but it seems the allowed attributes are selected in
the view and submitted somewhere. I want the list of allowed attributes
to be stored by the serviceRegistryDao in the mysql database I have set
up. My services whitelist is currently being stored by
serviceRegistryDao, that part works. I can look in the table and I see
mostly everything looks correct, but there is binary stuff where the
allowed attributes list should be.

So, my question is: What code takes the allowed attributes "submit"
action and stores the selected list in the database? Is it in
JpaTransactionManager or the class I configured for attributeRepository?

Thanks,

Robert Lewis
_______________________________________________
Yale CAS mailing list
cas@...
http://tp.its.yale.edu/mailman/listinfo/cas


_______________________________________________
Yale CAS mailing list
cas@...
http://tp.its.yale.edu/mailman/listinfo/cas

Parent Message unknown Re: allowedAttributes not being stored

by Robert Lewis :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Scott,

My dialect is set correctly for mysql and the services whitelist is
being stored and retrieved correctly. I think my problem has to do with
the attributeRepository bean. We want to store the allowed attributes in
the mysql database. It seems like I would use something like the following.


<bean id="attributeRepository"

class="org.jasig.services.persondir.support.jdbc.SingleRowJdbcPersonAttributeDao">
                <constructor-arg index="0" ref="dataSource"/>
                <constructor-arg>
            <list>
                <value>%u</value>
            </list>
        </constructor-arg>
        <constructor-arg>
            <value>
                SELECT tamuEduPersonNetID AS , cn, tamuEduPersonUIN,
tamuEduPersonNetID, mail, telephoneNumber
                FROM  cas_registry
                WHERE service=?
            </value>
        </constructor-arg>
                <property name="columnsToAttributes">
                <map>
<!-- Mapping between attributes (key) and Principal"s (value) -->
                <entry key="cn" value="Name"/>
                <entry key="tamuEduPersonUIN" value="uin"/>
                <entry key="tamuEduPersonNetID" value="user" />
                <entry key="mail" value="mail" />
                <entry key="telephoneNumber" value="telephoneNumber" />
                </map>
                </property>
        </bean>

Does the above make any sense as far as retrieving the allowed
attributes? One thing I need to change is the "%u" which is the
username. I need to change this to the service id, but I don't know how
to reference the service id in deployerConfigContext.xml; do you happen
to know to do that?

Thanks,

Robert Lewis

> Robert,
> Its using JPA/Hibernate to do the storage.  Do you have the correct
> dialect
> set for Hibernate?  I can give it a try under MySql, I think my
> notebook has
> it, but probably not until later or tomorrow.

> -Scott

> -Scott Battaglia
> PGP Public Key Id: 0x383733AA
> LinkedIn: http://www.linkedin.com/in/scottbattaglia

> On Thu, Jul 3, 2008 at 5:42 PM, Robert Lewis <r.lewis@...> wrote:

> >
> > Hi,
> >
> > In my services management feature of cas3.2.1, inside my java code, say
> > inside CentralAuthenticationServiceImpl.java, I am not able to retrieve
> > the allowed attributes using registeredService.getAllowedAttributes().
> > So, I am trying to follow thru where this info is stored and retrieved.
> >
> > In, add.jsp there is a submit action that submits the selected list in a
> > field, as follows.
> >
> > <form:select path="allowedAttributes" items="${availableAttributes}"
> > multiple="true" />
> >
> > and
> >
> >
> > <div class="actions">
> >                <button type="submit" class="primaryAction"
> > id="submit-wf_FormGardenDemonst" value="Save Changes"><spring:message
> > code="management.services.add.button.save" /></button> or <a
> > href="manage.html" style="color:#b00;"><spring:message
> > code="management.services.add.button.cancel" /></a>
> >        </div>
> >
> >
> > I don't know jsp, but it seems the allowed attributes are selected in
> > the view and submitted somewhere. I want the list of allowed attributes
> > to be stored by the serviceRegistryDao in the mysql database I have set
> > up. My services whitelist is currently being stored by
> > serviceRegistryDao, that part works. I can look in the table and I see
> > mostly everything looks correct, but there is binary stuff where the
> > allowed attributes list should be.
> >
> > So, my question is: What code takes the allowed attributes "submit"
> > action and stores the selected list in the database? Is it in
> > JpaTransactionManager or the class I configured for attributeRepository?
> >
> > Thanks,
> >
> > Robert Lewis
_______________________________________________
Yale CAS mailing list
cas@...
http://tp.its.yale.edu/mailman/listinfo/cas

Parent Message unknown Re: allowedAttributes not being stored

by Robert Lewis :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

I just saw some new docs Eric Dalquist put on the dashboard today. From
a quick look at that it seems I should be doing something like the
following.

<bean id="multiRowJdbcPersonAttributeDao"
class="org.jasig.services.persondir.support.jdbc.MultiRowJdbcPersonAttributeDao">
    <constructor-arg index="0" ref="dataSource" />
    <constructor-arg index="1" value="SELECT * FROM USER_DATA WHERE {0}" />
    <property name="nameValueColumnMappings">
        <map>
            <entry key="attr_name" value="attr_value" />
        </map>
    </property>
    <property name="queryAttributeMapping">
        <map>
            <entry key="username" value="uid" />
        </map>
    </property>
    <property name="resultAttributeMapping">
        <map>
            <entry key="uid" value="username" />
            <entry key="first_name" value="first_name" />
            <entry key="last_name" value="last_name" />
            <entry key="email" value="email" />
        </map>
    </property>
</bean>

However, my attributes are stored per service id. I will modify the
above for my case.

Thanks,

Robert Lewis


> Hi Scott,

> My dialect is set correctly for mysql and the services whitelist is
> being stored and retrieved correctly. I think my problem has to do
> with
> the attributeRepository bean. We want to store the allowed attributes > in
> the mysql database. It seems like I would use something like the
> following.


>  <bean id="attributeRepository"
>
class="org.jasig.services.persondir.support.jdbc.SingleRowJdbcPersonAttributeDao">
                <constructor-arg index="0" ref="dataSource"/>
                <constructor-arg>
            <list>
                <value>%u</value>
            </list>
        </constructor-arg>
        <constructor-arg>
            <value>
                SELECT tamuEduPersonNetID AS , cn, tamuEduPersonUIN,
tamuEduPersonNetID, mail, telephoneNumber
                FROM  cas_registry
                WHERE service=?
            </value>
        </constructor-arg>
                <property name="columnsToAttributes">
                <map>
<!-- Mapping between attributes (key) and Principal"s (value) -->
                <entry key="cn" value="Name"/>
                <entry key="tamuEduPersonUIN" value="uin"/>
                <entry key="tamuEduPersonNetID" value="user" />
                <entry key="mail" value="mail" />
                <entry key="telephoneNumber" value="telephoneNumber" />
                </map>
                </property>
        </bean>

> Does the above make any sense as far as retrieving the allowed
> attributes? One thing I need to change is the "%u" which is the
> username. I need to change this to the service id, but I don't know
> how
> to reference the service id in deployerConfigContext.xml; do you
> happen
> to know to do that?

> Thanks,

> Robert Lewis

> > Robert,
> > Its using JPA/Hibernate to do the storage.  Do you have the correct
> > dialect
> > set for Hibernate?  I can give it a try under MySql, I think my
> > notebook has
> > it, but probably not until later or tomorrow.

> > -Scott
_______________________________________________
Yale CAS mailing list
cas@...
http://tp.its.yale.edu/mailman/listinfo/cas

Re: allowedAttributes not being stored

by scott_battaglia :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Let me know if it works!  Just in case we need to make any changes before the 3.3 final release.

Thanks
-Scott


On Mon, Jul 14, 2008 at 3:16 PM, Robert Lewis <r.lewis@...> wrote:
Hi,

I just saw some new docs Eric Dalquist put on the dashboard today. From
a quick look at that it seems I should be doing something like the
following.

<bean id="multiRowJdbcPersonAttributeDao"
class="org.jasig.services.persondir.support.jdbc.MultiRowJdbcPersonAttributeDao">
   <constructor-arg index="0" ref="dataSource" />
   <constructor-arg index="1" value="SELECT * FROM USER_DATA WHERE {0}" />
   <property name="nameValueColumnMappings">
       <map>
           <entry key="attr_name" value="attr_value" />
       </map>
   </property>
   <property name="queryAttributeMapping">
       <map>
           <entry key="username" value="uid" />
       </map>
   </property>
   <property name="resultAttributeMapping">
       <map>
           <entry key="uid" value="username" />
           <entry key="first_name" value="first_name" />
           <entry key="last_name" value="last_name" />
           <entry key="email" value="email" />
       </map>
   </property>
</bean>

However, my attributes are stored per service id. I will modify the
above for my case.

Thanks,

Robert Lewis


> Hi Scott,

> My dialect is set correctly for mysql and the services whitelist is
> being stored and retrieved correctly. I think my problem has to do
> with
> the attributeRepository bean. We want to store the allowed attributes > in
> the mysql database. It seems like I would use something like the
> following.


>  <bean id="attributeRepository"
>
class="org.jasig.services.persondir.support.jdbc.SingleRowJdbcPersonAttributeDao">
               <constructor-arg index="0" ref="dataSource"/>
               <constructor-arg>
                       <list>
                               <value>%u</value>
                       </list>
                       </constructor-arg>
                       <constructor-arg>
                       <value>
               SELECT tamuEduPersonNetID AS , cn, tamuEduPersonUIN,
tamuEduPersonNetID, mail, telephoneNumber
               FROM  cas_registry
               WHERE service=?
                       </value>
                       </constructor-arg>
               <property name="columnsToAttributes">
               <map>
<!-- Mapping between attributes (key) and Principal"s (value) -->
               <entry key="cn" value="Name"/>
               <entry key="tamuEduPersonUIN" value="uin"/>
               <entry key="tamuEduPersonNetID" value="user" />
               <entry key="mail" value="mail" />
               <entry key="telephoneNumber" value="telephoneNumber" />
               </map>
               </property>
       </bean>

> Does the above make any sense as far as retrieving the allowed
> attributes? One thing I need to change is the "%u" which is the
> username. I need to change this to the service id, but I don't know
> how
> to reference the service id in deployerConfigContext.xml; do you
> happen
> to know to do that?

> Thanks,

> Robert Lewis

> > Robert,
> > Its using JPA/Hibernate to do the storage.  Do you have the correct
> > dialect
> > set for Hibernate?  I can give it a try under MySql, I think my
> > notebook has
> > it, but probably not until later or tomorrow.

> > -Scott
_______________________________________________
Yale CAS mailing list
cas@...
http://tp.its.yale.edu/mailman/listinfo/cas


_______________________________________________
Yale CAS mailing list
cas@...
http://tp.its.yale.edu/mailman/listinfo/cas

Parent Message unknown Re: allowedAttributes not being stored

by Robert Lewis :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

I tried Eric's bean, but had to modify it to get it to deploy. What I
have now for this bean is the below.

<bean id="attributeRepository"

class="org.jasig.services.persondir.support.jdbc.MultiRowJdbcPersonAttributeDao">
  <constructor-arg index="0" ref="dataSource"/>
  <constructor-arg index="1" value="%serviceId"/>
  <constructor-arg index="2" value="SELECT * FROM cas_registry WHERE {0}" />
  <property name="nameValueColumnMappings">
     <map>
<!-- Mapping between attributes (key) and Principal"s (value) -->
        <entry key="cn" value="Name"/>
        <entry key="tamuEduPersonUIN" value="uin"/>
        <entry key="tamuEduPersonNetID" value="user" />
        <entry key="mail" value="mail" />
        <entry key="telephoneNumber" value="telephoneNumber" />
     </map>
  </property>
</bean>

Now a problem is that on the services management view, adding a service,
there are no attributes listed for selection. The added service is
allowed to access cas, so the whitelist feature is working.

I am getting in the log the following.

Hibernate: insert into RegisteredServiceImpl (allowedAttributes,
allowedToProxy, anonymousAccess, description, enabled, name, serviceId,
ssoEnabled, theme) values (?, ?, ?, ?, ?, ?, ?, ?, ?)

So, it looks to me that nothing is being put into the attribute repository.

Questions I have are: Is there something else I have to do to get
Hibernate to insert the allowed attributes map in the database? And, in
the above bean, at constructor index='1' it seems like I would give it
the service url to retrieve the allowed attibutes for that service, but
how do I give it the service url inside deployerContextConfig.xml? I am
guessing %serviceId, but can anyone tell me if thats correct?

Thanks,

Robert Lewis


> Date: Mon, 14 Jul 2008 14:16:56 -0500
> From: Robert Lewis <r.lewis@...>
> Subject: Re: allowedAttributes not being stored
> To: cas@...
> Message-ID: <487BA628.603@...>
> Content-Type: text/plain; charset=ISO-8859-1

> Hi,

> I just saw some new docs Eric Dalquist put on the dashboard today.
> From a quick look at that it seems I should be doing something like
> the following.

<bean id="multiRowJdbcPersonAttributeDao"
class="org.jasig.services.persondir.support.jdbc.MultiRowJdbcPersonAttributeDao">
    <constructor-arg index="0" ref="dataSource" />
    <constructor-arg index="1" value="SELECT * FROM USER_DATA WHERE {0}" />
    <property name="nameValueColumnMappings">
        <map>
            <entry key="attr_name" value="attr_value" />
        </map>
    </property>
    <property name="queryAttributeMapping">
        <map>
            <entry key="username" value="uid" />
        </map>
    </property>
    <property name="resultAttributeMapping">
        <map>
            <entry key="uid" value="username" />
            <entry key="first_name" value="first_name" />
            <entry key="last_name" value="last_name" />
            <entry key="email" value="email" />
        </map>
    </property>
</bean>

> However, my attributes are stored per service id. I will modify the
> above for my case.

_______________________________________________
Yale CAS mailing list
cas@...
http://tp.its.yale.edu/mailman/listinfo/cas

Re: allowedAttributes not being stored

by scott_battaglia :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Robert,

This may seem like a completely dumb question but when you view the service in the Services Management tool, before you save it, are you selecting the attributes in the multi-valued dropdown and then pressing save?

AttributeRepository is used to display the list of potential attributes a service could access, while the Services Management tool allows you to select which ones it actually can access.

-Scott

-Scott Battaglia
PGP Public Key Id: 0x383733AA
LinkedIn: http://www.linkedin.com/in/scottbattaglia

On Tue, Jul 15, 2008 at 5:52 PM, Robert Lewis <r.lewis@...> wrote:
Hi,

I tried Eric's bean, but had to modify it to get it to deploy. What I
have now for this bean is the below.

<bean id="attributeRepository"

class="org.jasig.services.persondir.support.jdbc.MultiRowJdbcPersonAttributeDao">
 <constructor-arg index="0" ref="dataSource"/>
 <constructor-arg index="1" value="%serviceId"/>
 <constructor-arg index="2" value="SELECT * FROM cas_registry WHERE {0}" />
 <property name="nameValueColumnMappings">
    <map>
<!-- Mapping between attributes (key) and Principal"s (value) -->
       <entry key="cn" value="Name"/>
       <entry key="tamuEduPersonUIN" value="uin"/>
       <entry key="tamuEduPersonNetID" value="user" />
       <entry key="mail" value="mail" />
       <entry key="telephoneNumber" value="telephoneNumber" />
    </map>
 </property>
</bean>

Now a problem is that on the services management view, adding a service,
there are no attributes listed for selection. The added service is
allowed to access cas, so the whitelist feature is working.

I am getting in the log the following.

Hibernate: insert into RegisteredServiceImpl (allowedAttributes,
allowedToProxy, anonymousAccess, description, enabled, name, serviceId,
ssoEnabled, theme) values (?, ?, ?, ?, ?, ?, ?, ?, ?)

So, it looks to me that nothing is being put into the attribute repository.

Questions I have are: Is there something else I have to do to get
Hibernate to insert the allowed attributes map in the database? And, in
the above bean, at constructor index='1' it seems like I would give it
the service url to retrieve the allowed attibutes for that service, but
how do I give it the service url inside deployerContextConfig.xml? I am
guessing %serviceId, but can anyone tell me if thats correct?

Thanks,

Robert Lewis


> Date: Mon, 14 Jul 2008 14:16:56 -0500
> From: Robert Lewis <r.lewis@...>
> Subject: Re: allowedAttributes not being stored
> To: cas@...
> Message-ID: <487BA628.603@...>
> Content-Type: text/plain; charset=ISO-8859-1

> Hi,

> I just saw some new docs Eric Dalquist put on the dashboard today.
> From a quick look at that it seems I should be doing something like
> the following.

<bean id="multiRowJdbcPersonAttributeDao"
class="org.jasig.services.persondir.support.jdbc.MultiRowJdbcPersonAttributeDao">
   <constructor-arg index="0" ref="dataSource" />
   <constructor-arg index="1" value="SELECT * FROM USER_DATA WHERE {0}" />
   <property name="nameValueColumnMappings">
       <map>
           <entry key="attr_name" value="attr_value" />
       </map>
   </property>
   <property name="queryAttributeMapping">
       <map>
           <entry key="username" value="uid" />
       </map>
   </property>
   <property name="resultAttributeMapping">
       <map>
           <entry key="uid" value="username" />
           <entry key="first_name" value="first_name" />
           <entry key="last_name" value="last_name" />
           <entry key="email" value="email" />
       </map>
   </property>
</bean>

> However, my attributes are stored per service id. I will modify the
> above for my case.

_______________________________________________
Yale CAS mailing list
cas@...
http://tp.its.yale.edu/mailman/listinfo/cas


_______________________________________________
Yale CAS mailing list
cas@...
http://tp.its.yale.edu/mailman/listinfo/cas

Parent Message unknown Re: allowedAttributes not being stored

by Robert Lewis :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Scott,

First background, when I used StubPersonAttributeDao per the user's
manual, I did see the backingMap attributes in the multi-valued dropdown
when I add the service. As a test, I selected a couple of the attributes
as allowed attributes. Then, I could use discovery to look in the mysql
db and see the service and all fields looked normal, except the allowed
attributes field had binary stuff in it. Finally, I used a log message
to list the allowed attributes retrieved by getAlowedAttributes(), and
it showed no allowed attributes being retrieved.

Then I changed the attributeRepository bean class to
MultiRowJdbcPersonAttributeDao as previously described, which has the
attribute map in property named nameValueColumnMappings.

Using this class for the attributeRepository bean, the behavior I am
observing when I add a service is the multi-valued dropdown has nothing
in it.

I guess hibernate is not picking up the attribute map. I need some help
on configuring this, any help would be appreciated.

Thanks,

Robert Lewis


> Robert,
> This may seem like a completely dumb question but when you view the
> service
> in the Services Management tool, before you save it, are you selecting
> the
> attributes in the multi-valued dropdown and then pressing save?

> AttributeRepository is used to display the list of potential
> attributes a
> service could access, while the Services Management tool allows you to
> select which ones it actually can access.

> -Scott
_______________________________________________
Yale CAS mailing list
cas@...
http://tp.its.yale.edu/mailman/listinfo/cas

Re: allowedAttributes not being stored

by scott_battaglia :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Robert,

We made some changes to the way attributes are stored for 3.3-RC3.  Can you check out the HEAD and see if that works?  It stores them in a different table vs. the single column

-Scott

-Scott Battaglia
PGP Public Key Id: 0x383733AA
LinkedIn: http://www.linkedin.com/in/scottbattaglia


On Wed, Jul 16, 2008 at 1:16 PM, Robert Lewis <r.lewis@...> wrote:
Hi Scott,

First background, when I used StubPersonAttributeDao per the user's
manual, I did see the backingMap attributes in the multi-valued dropdown
when I add the service. As a test, I selected a couple of the attributes
as allowed attributes. Then, I could use discovery to look in the mysql
db and see the service and all fields looked normal, except the allowed
attributes field had binary stuff in it. Finally, I used a log message
to list the allowed attributes retrieved by getAlowedAttributes(), and
it showed no allowed attributes being retrieved.

Then I changed the attributeRepository bean class to
MultiRowJdbcPersonAttributeDao as previously described, which has the
attribute map in property named nameValueColumnMappings.

Using this class for the attributeRepository bean, the behavior I am
observing when I add a service is the multi-valued dropdown has nothing
in it.

I guess hibernate is not picking up the attribute map. I need some help
on configuring this, any help would be appreciated.

Thanks,

Robert Lewis


> Robert,
> This may seem like a completely dumb question but when you view the
> service
> in the Services Management tool, before you save it, are you selecting
> the
> attributes in the multi-valued dropdown and then pressing save?

> AttributeRepository is used to display the list of potential
> attributes a
> service could access, while the Services Management tool allows you to
> select which ones it actually can access.

> -Scott
_______________________________________________
Yale CAS mailing list
cas@...
http://tp.its.yale.edu/mailman/listinfo/cas


_______________________________________________
Yale CAS mailing list
cas@...
http://tp.its.yale.edu/mailman/listinfo/cas
LightInTheBox - Buy quality products at wholesale price