Closed ceciliazcx closed 8 years ago
In fact, the CAS server and management webapp have been "Spring bootified", so I must change the demos to match that. I'll try to do that next week (in holidays this week).
oh. Got it. Thx. I am going to use other branch.
Could I ask a question here? I use Branch 4.0.x. When I use cas client(spring-webmvc-pac4j-boot-demo) to call it, the return casProfile is as following:
profile: <CasProfile> | id: jleleu | attributes: {} | roles: [] | permissions: [] | isRemembered: false |
I want to also have roles and attributes in the return data. the mock data is fine. I read deployerConfigContext.xml, I saw the code as following:
<!--
Bean that defines the attributes that a service may return. This example uses the Stub/Mock version. A real implementation
may go against a database or LDAP server. The id should remain "attributeRepository" though.
+-->
<bean id="attributeRepository" class="org.jasig.services.persondir.support.StubPersonAttributeDao"
p:backingMap-ref="attrRepoBackingMap" />
<util:map id="attrRepoBackingMap">
<entry key="uid" value="uid" />
<entry key="prénom" value="eduPersonAffiliation" />
<entry key="groupMembership" value="groupMembership" />
</util:map>
I assume the above code is means we already have the mock data to be add to the attributes of return data. DO I misunderstand anything? How could I add a mock attribute and role to the return data? Thanks
There are two issues to get the user attributes:
primaryAuthenticationHandler
<-> primaryPrincipalResolver
<-> attributeRepository
<-> attrRepoBackingMap
Thanks for your reply.
For the client, I am so confused. what is the meaning of login url minus /login plus /p3
? I do not think I have any login in url.
In the server part, I have deployerConfigContext.xml
as following:
primaryAuthenticationHandler:
<bean id="primaryAuthenticationHandler" class="org.jasig.cas.authentication.AcceptUsersAuthenticationHandler">
<property name="users">
<map>
<entry key="test" value="1234"/>
</map>
</property>
</bean>
primaryPrincipalResolver:
<bean id="primaryPrincipalResolver"
class="org.jasig.cas.authentication.principal.PersonDirectoryPrincipalResolver" >
<property name="attributeRepository" ref="attributeRepository" />
</bean>
attributeRepository:
<bean id="attributeRepository" class="org.jasig.services.persondir.support.StubPersonAttributeDao"
p:backingMap-ref="attrRepoBackingMap" />
<util:map id="attrRepoBackingMap">
<entry key="uid" value="uid" />
<entry key="prénom" value="eduPersonAffiliation" />
<entry key="groupMembership" value="groupMembership" />
</util:map>
And I use the following link to view the attribute. but there is no attribute. DO I missing anything?
http://localhost:8888/cas/login?service=http://localhost:8080 http://localhost:8888/cas/serviceValidate?ticket=ST-1-TPB23eEGopR02dcIv9Fh-cas01.example.org&service=http://localhost:8080
To be straight, you should use the following url: http://localhost:8888/cas/p3/serviceValidate?ticket=ST-1-TPB23eEGopR02dcIv9Fh-cas01.example.org&service=http://localhost:8080 Note the /p3 part
But there still no attribute showing there. My server is exactly as my last reply. Did I still missing anything?
Can you turn on DEBUG logs on org.jasig.cas on client side? To see what's going on...
I did not use client at this moment. only the server part and use "cas/p3/serviceValidate?ticket=" to call the server.
I updated the 4.2.x branch, it should be ok on this one.
I was able to run cas server last week (but cas-management does not work). I get the newest version of code from master branch today, and firstly, I got following failure when building it:
then I add web.xml to management demo as following:
After this change, I can build successfully. But there is error when I try to run the project, the 2 main errors are as following: The first error is as following:
The second error is as following: