[jboss-user] [JBoss Seam] - Re: How can I integrate CAS client into Seam?
wuhaixing
do-not-reply at jboss.com
Mon Oct 1 21:23:47 EDT 2007
This is what in my web.xml
| <filter>
| <filter-name>CAS Filter</filter-name>
| <filter-class>edu.yale.its.tp.cas.client.filter.CASFilter</filter-class>
| <init-param>
| <param-name>edu.yale.its.tp.cas.client.filter.loginUrl</param-name>
| <param-value>https://localhost:8443/cas/login</param-value>
| </init-param>
| <init-param>
| <param-name>edu.yale.its.tp.cas.client.filter.validateUrl</param-name>
| <param-value>https://localhost:8443/cas/proxyValidate</param-value>
| </init-param>
| <init-param>
| <param-name>edu.yale.its.tp.cas.client.filter.serviceUrl</param-name>
| <param-value>http://localhost:8080/epass/login.seam</param-value>
| </init-param>
| </filter>
|
and this is in the page.xml
| <page view-id="/login.xhtml" action="#{identity.login}">
| <navigation from-action="#{identity.login}">
| <rule if="#{identity.loggedIn}">
| <redirect view-id="/home.xhtml"></redirect>
| </rule>
| <rule if="#{not identity.loggedIn}">
| <redirect view-id="/users/register.xhtml"></redirect>
| </rule>
| </navigation>
| </page>
|
and then in the components.xml ,I have this
| <security:identity authenticate-method="#{authenticator.authenticate}"/>
|
In the authenticator...
| public boolean authenticate()
| {
| String username = (String)Contexts.getSessionContext().get(CASFilter.CAS_FILTER_USER);
| if(username != null) {
| identity.setUsername(username);
| }
| log.info("authenticating #0", identity.getUsername());
| //write your authentication logic here,
| identity.addRole("admin");
| return true;
| }
|
the log told me
anonymous wrote :
| 09:18:11,085 INFO [Contexts] starting up: org.jboss.seam.security.identity
| 09:18:11,092 WARN [RuleBasedIdentity] no security rule base available - please install a RuleBase with the name 'securityRules' if permission checks are required.
| 09:18:11,095 INFO [Contexts] starting up: org.jboss.seam.web.session
| 09:18:13,283 INFO [STDOUT] 2007-10-02 09:18:13,282 INFO [org.jasig.cas.web.flow.InitialFlowSetupAction] - <Setting ContextPath for cookies to: /cas>
| 09:18:19,535 INFO [STDOUT] 2007-10-02 09:18:19,534 INFO [org.jasig.cas.authentication.AuthenticationManagerImpl] - <AuthenticationHandler: org.jasig.cas.adaptors.jdbc.QueryDatabaseAuthenticationHandler successfully authenticated the user which provided the following credentials
| >
| 09:18:19,572 INFO [STDOUT] 2007-10-02 09:18:19,572 INFO [org.jasig.cas.CentralAuthenticationServiceImpl] - <Granted service ticket [ST-1-lHKcFO0JY3WxO3lLJrx0a17yhjDhF5fhUmD-20] for service [http://localhost:8080/epass/login.seam] for user [wuhaixing]>
| 09:18:19,709 INFO [Contexts] starting up: org.jboss.seam.security.identity
| 09:18:19,715 WARN [RuleBasedIdentity] no security rule base available - please install a RuleBase with the name 'securityRules' if permission checks are required.
| 09:18:19,718 INFO [Contexts] starting up: org.jboss.seam.web.session
| 09:18:20,054 WARN [SkinFactoryImpl] Init parameter for a skin name changed to org.richfaces.SKIN
| 09:18:20,177 INFO [Authenticator] authenticating null
|
What's wrong?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4090456#4090456
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4090456
More information about the jboss-user
mailing list