<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
	<channel>
		<title><![CDATA[Latest posts for the topic "ICEfaces & Acegi : Any example"]]></title>
		<link>http://www.icefaces.org/JForum/posts/list/12.page</link>
		<description><![CDATA[Latest messages posted in the topic "ICEfaces & Acegi : Any example"]]></description>
		<generator>JForum - http://www.jforum.net</generator>
			<item>
				<title>ICEfaces &amp; Acegi : Any example</title>
				<description><![CDATA[ I wonder whether any of you could share to us a sample code how to integrate ICEfaces and Acegi.

Thanks for any help/suggestions.
]]></description>
				<guid isPermaLink="true">http://www.icefaces.org/JForum/posts/list/3390.page#15883</guid>
				<link>http://www.icefaces.org/JForum/posts/list/3390.page#15883</link>
				<pubDate><![CDATA[Sat, 13 Jan 2007 10:30:50]]> GMT</pubDate>
				<author><![CDATA[ nusa]]></author>
			</item>
			<item>
				<title>ICEfaces &amp; Acegi : Any example</title>
				<description><![CDATA[ Although the icefaces/lib directory got acegi-security-1.0.1.jar file, but there is no example how to use it in the icefaces/samples directory.

philip_b, could you gives us some hints or a sample code ?

Thanks.]]></description>
				<guid isPermaLink="true">http://www.icefaces.org/JForum/posts/list/3390.page#15888</guid>
				<link>http://www.icefaces.org/JForum/posts/list/3390.page#15888</link>
				<pubDate><![CDATA[Sat, 13 Jan 2007 13:03:35]]> GMT</pubDate>
				<author><![CDATA[ nusa]]></author>
			</item>
			<item>
				<title>Re:ICEfaces &amp; Acegi : Any example</title>
				<description><![CDATA[ Hi,

Here's a basic ICEfaces-Acegi example. It's simply the base acegi example modified. Acegi and dependent jars are included.

Thanks,
Philip]]></description>
				<guid isPermaLink="true">http://www.icefaces.org/JForum/posts/list/3390.page#15914</guid>
				<link>http://www.icefaces.org/JForum/posts/list/3390.page#15914</link>
				<pubDate><![CDATA[Mon, 15 Jan 2007 14:47:24]]> GMT</pubDate>
				<author><![CDATA[ philip.breau]]></author>
			</item>
			<item>
				<title>ICEfaces &amp; Acegi : Any example</title>
				<description><![CDATA[ Thanks Philip.

Will this be part of example for the incoming 1.5.2 ?]]></description>
				<guid isPermaLink="true">http://www.icefaces.org/JForum/posts/list/3390.page#15948</guid>
				<link>http://www.icefaces.org/JForum/posts/list/3390.page#15948</link>
				<pubDate><![CDATA[Tue, 16 Jan 2007 12:46:17]]> GMT</pubDate>
				<author><![CDATA[ nusa]]></author>
			</item>
			<item>
				<title>Re:ICEfaces &amp; Acegi : Any example</title>
				<description><![CDATA[ Hi,

No, it's just a modified example from the acegi download.

Cheers,
Philip]]></description>
				<guid isPermaLink="true">http://www.icefaces.org/JForum/posts/list/3390.page#15956</guid>
				<link>http://www.icefaces.org/JForum/posts/list/3390.page#15956</link>
				<pubDate><![CDATA[Tue, 16 Jan 2007 16:59:37]]> GMT</pubDate>
				<author><![CDATA[ philip.breau]]></author>
			</item>
			<item>
				<title>Re:ICEfaces &amp; Acegi : Any example</title>
				<description><![CDATA[ Hi Phillip,

I'm just confused by the reference to loginProxy.jsp.

Could you clarify that a little please?

Cheers
J]]></description>
				<guid isPermaLink="true">http://www.icefaces.org/JForum/posts/list/3390.page#16915</guid>
				<link>http://www.icefaces.org/JForum/posts/list/3390.page#16915</link>
				<pubDate><![CDATA[Sun, 11 Feb 2007 04:32:24]]> GMT</pubDate>
				<author><![CDATA[ johnny]]></author>
			</item>
			<item>
				<title>Re:ICEfaces &amp; Acegi : Any example</title>
				<description><![CDATA[ Sure, good question, that refers to something that was unfinished in that example. In general, it's a challenge to create JAAS login pages in JSF as the JSF element name-mangling gets in the way of needing to post 'j_username' and 'j_password' field ids. MyFaces Tomahawk has a 'forceId' attribute to get around this, but we don't. So, originally, this example just used a normal JSP page for the login page. 

I then ran into this smart workaround by Duncan Mills (http://groundside.com/blog/DuncanMills.php?title=j2ee_security_a_jsf_based_login_form&more=1&c=1&tb=1&pb=1) which involves redirecting to a loginProxy.jsp which reposts the fields with their expected ids. This allows you to have a rich ICEfaces login page using JAAS. I've attached the finished example.

Thanks,
Philip]]></description>
				<guid isPermaLink="true">http://www.icefaces.org/JForum/posts/list/3390.page#16993</guid>
				<link>http://www.icefaces.org/JForum/posts/list/3390.page#16993</link>
				<pubDate><![CDATA[Tue, 13 Feb 2007 10:20:55]]> GMT</pubDate>
				<author><![CDATA[ philip.breau]]></author>
			</item>
			<item>
				<title>ICEfaces &amp; Acegi : Any example</title>
				<description><![CDATA[ Thank you very much philip,

I have Acegie working at the moment although i do get that redirect page showing on the screen temporarily while authentication is taking place.

But all good for now ;-)

Once again, thank you.
J]]></description>
				<guid isPermaLink="true">http://www.icefaces.org/JForum/posts/list/3390.page#17190</guid>
				<link>http://www.icefaces.org/JForum/posts/list/3390.page#17190</link>
				<pubDate><![CDATA[Sat, 17 Feb 2007 15:13:04]]> GMT</pubDate>
				<author><![CDATA[ johnny]]></author>
			</item>
			<item>
				<title>Re:ICEfaces &amp; Acegi : Any example</title>
				<description><![CDATA[ I've not used Spring before, so I was wondering if it is possible to get an example of ICEfaces + ACEGI without spring.

Regards,
Eashwaran.]]></description>
				<guid isPermaLink="true">http://www.icefaces.org/JForum/posts/list/3390.page#18909</guid>
				<link>http://www.icefaces.org/JForum/posts/list/3390.page#18909</link>
				<pubDate><![CDATA[Wed, 18 Apr 2007 14:10:24]]> GMT</pubDate>
				<author><![CDATA[ eashwaranp]]></author>
			</item>
			<item>
				<title>Re:ICEfaces &amp; Acegi : Any example</title>
				<description><![CDATA[ Hi Eashwaran,

Acegi is a sub-project of Spring and depends on the basic Spring jars. But don't worry if you haven't used Spring before, no specific knowledge is required to use a basic configuration.

Philip]]></description>
				<guid isPermaLink="true">http://www.icefaces.org/JForum/posts/list/3390.page#18910</guid>
				<link>http://www.icefaces.org/JForum/posts/list/3390.page#18910</link>
				<pubDate><![CDATA[Wed, 18 Apr 2007 14:42:27]]> GMT</pubDate>
				<author><![CDATA[ philip.breau]]></author>
			</item>
			<item>
				<title>Re:ICEfaces &amp; Acegi : Any example</title>
				<description><![CDATA[ Thanks.  What are those basic spring jars and where can I get them?  I just need the ones for running your example.

Also, do we really need the org.springframework.web.context.ContextLoaderListener listener?  

It would be nice if we just limit the example to only the jars that are needed.  I see a lot more jars, like 

C:\temp\acegi-example\web\WEB-INF\lib>ls *.jar
aopalliance.jar             commons-lang.jar
aspectjrt.jar               ehcache-1.2.3.jar
commons-attributes-api.jar  jakarta-oro-2.0.8.jar
commons-codec.jar           jstl-1.0.6.jar
commons-collections.jar     standard-1.0.6.jar

I understand the need for jstl and standard, but are the others needed to get acegi security working?

Please forgive my ignorance of spring framework.  I don't have too much time to invest learning spring now or to investigate how to get acegi working.  

All I want is some mechanism in ICEfaces to allow me to do rolebased security checks.   I see that you have used a text file user.properties in your example to layout the user, password and roles.  Is it possible to use a Database instead?  If so, can you please guide me on how I can achieve this with a database?

Regards,
Eashwaran.]]></description>
				<guid isPermaLink="true">http://www.icefaces.org/JForum/posts/list/3390.page#18919</guid>
				<link>http://www.icefaces.org/JForum/posts/list/3390.page#18919</link>
				<pubDate><![CDATA[Wed, 18 Apr 2007 15:08:17]]> GMT</pubDate>
				<author><![CDATA[ eashwaranp]]></author>
			</item>
			<item>
				<title>Re:ICEfaces &amp; Acegi : Any example</title>
				<description><![CDATA[ I would recommend reading the acegi documentation which is pretty good.  I did this by implementing my own acegi UserDetailsService:

In your applicationContext.xml implement your own UserDetailsService:
<span class="genmed"><b>Code:</b></span><br>
		<div style="overflow: auto; width: 100%;">
		<pre>
	&lt;bean id="userDetailsService" class="com.icesoft.icefaces.acegi.OurUserDetailsService"&gt;

	&lt;/bean&gt;
</pre>
		</div>

Acegi has a recommeded SQL schema to make things easier when accessing a database.  I used an existing user database to match similar fields with the acegi User object (iwhere I didn't have a match, I set the attribute to TRUE).  I then used groups from this database to define my User's GrantedAuthorities by concatenating ROLE_ to the group name.  This allows you to use the ICEfaces component attributes enabledOnUserRole/renderedOnUserRole:
<span class="genmed"><b>Code:</b></span><br>
		<div style="overflow: auto; width: 100%;">
		<pre>
public class OurUserDetailsService implements UserDetailsService {
    
    private Connection authenticationConnection;

    public UserDetails loadUserByUsername&#40;String username&#41;
            throws UsernameNotFoundException, DataAccessException {

        authenticationConnection = DBObject.getInstance&#40;&#41;.setupConnection&#40;"icefaces","icefaces","localhost","usertable"&#41;;

        try{
            Statement authenticationStatement = authenticationConnection.createStatement&#40;&#41;;
            
            ResultSet results = authenticationStatement.executeQuery&#40;"SELECT user_id, user_enabled, user_password, user_locked, FROM usertable WHERE username = \"" + username + "\";"&#41;;
            if&#40;results.first&#40;&#41;&#41;{
                int id = results.getInt&#40;1&#41;;
                Boolean enabled = results.getBoolean&#40;2&#41;;
                String password = results.getString&#40;3&#41;;
                Boolean locked = results.getBoolean&#40;4&#41;;
            
                results = authenticationStatement.executeQuery&#40;"SELECT ug.group_id, g.group_name FROM usergroups ug, groups g WHERE ug.group_id = g.group_id AND ug.user_id = \"" + id + "\" ORDER BY g.group_id;"&#41;;
                ArrayList tempGrantedAuthorities = new ArrayList&#40;&#41;;
                while &#40;results.next&#40;&#41;&#41; {
                    GrantedAuthority temp = new GrantedAuthorityImpl&#40;"ROLE_" + results.getString&#40;"group_name"&#41;&#41;;
                    tempGrantedAuthorities.add&#40;temp&#41;;
                }
                GrantedAuthority&#91;&#93; grantedAuthorities = new GrantedAuthority&#91;tempGrantedAuthorities.size&#40;&#41;&#93;; 
                tempGrantedAuthorities.toArray&#40;grantedAuthorities&#41;;
                             
                authenticationStatement.close&#40;&#41;;
                return new User&#40;username,password,enabled,Boolean.TRUE,Boolean.TRUE,locked,grantedAuthorities&#41;;
            }else{
                throw new UsernameNotFoundException&#40;"Username Not Found"&#41;;
            }
        }catch &#40;SQLException sqe&#41; {
            sqe.printStackTrace&#40;&#41;;
        }
        return null;
    }

}
</pre>
		</div>]]></description>
				<guid isPermaLink="true">http://www.icefaces.org/JForum/posts/list/3390.page#19160</guid>
				<link>http://www.icefaces.org/JForum/posts/list/3390.page#19160</link>
				<pubDate><![CDATA[Wed, 25 Apr 2007 12:24:13]]> GMT</pubDate>
				<author><![CDATA[ brad.kroeger]]></author>
			</item>
			<item>
				<title>Re:ICEfaces &amp; Acegi : Any example</title>
				<description><![CDATA[ I have added an example of a full ICEfaces/acegi implementation in this post:

http://www.icefaces.org/JForum/posts/list/1625.page]]></description>
				<guid isPermaLink="true">http://www.icefaces.org/JForum/posts/list/3390.page#19734</guid>
				<link>http://www.icefaces.org/JForum/posts/list/3390.page#19734</link>
				<pubDate><![CDATA[Thu, 10 May 2007 12:09:34]]> GMT</pubDate>
				<author><![CDATA[ brad.kroeger]]></author>
			</item>
			<item>
				<title>Re:ICEfaces &amp; Acegi : Any example</title>
				<description><![CDATA[ Hello,

Thanks for the info.  I just got both your examples running on my box; still have to research them though.

I thought I'll update you with the info on spring jars.  The acegi-example (with the tree) only needs spring.jar from Spring, which was missing in the lib dir of the package.

The security.war example (with the JMS queues) that Brad posted in another link also has a lot of jars in the lib dir, but it seems to need only commons-lang.jar,  jakarta-oro-2.0.8.jar, ehcache-1.2.4.jar, and spring.jar.  

Please note that these are in addition to the jars that are shipped with Eclipse plugin for ICEfaces, and ofcourse acegi-security-1.0.1.jar and servlet-api.jar.

I got the examples working with above jars.   In case I missed any jar or if I've stated anything in error, please feel free to correct me.

Regards,
Eashwaran.]]></description>
				<guid isPermaLink="true">http://www.icefaces.org/JForum/posts/list/3390.page#20963</guid>
				<link>http://www.icefaces.org/JForum/posts/list/3390.page#20963</link>
				<pubDate><![CDATA[Wed, 6 Jun 2007 16:35:33]]> GMT</pubDate>
				<author><![CDATA[ eashwaranp]]></author>
			</item>
			<item>
				<title>Re:ICEfaces &amp; Acegi : Any example</title>
				<description><![CDATA[ thanks very much. i 've been using spring + acegi and now icefaces.]]></description>
				<guid isPermaLink="true">http://www.icefaces.org/JForum/posts/list/3390.page#21012</guid>
				<link>http://www.icefaces.org/JForum/posts/list/3390.page#21012</link>
				<pubDate><![CDATA[Thu, 7 Jun 2007 14:01:55]]> GMT</pubDate>
				<author><![CDATA[ jotache]]></author>
			</item>
	</channel>
</rss>
