answer to your questions is yes
You can create and configure your own login modules and you can leevrage authentication to use SSO for instance. You can also configre authorization and make some pages or portlets accessible only to some users. Please see User guide and Reference guide for more details (http://www.jboss.org/gatein/documentation ). I suggest to use latest GateIn 3.2.Beta01 and documentation for this release.
There is also new documentation chapter about Authentication and authorization, but you can't find it in official docs right now, because it's new and so it's only in docs sources. You may need to checkout latest docs stuff http://anonsvn.jboss.org/repos/gatein/portal/trunk/docs/ and build it by yourself with maven or look at docbook sources here http://anonsvn.jboss.org/repos/gatein/portal/trunk/docs/reference-guide/en-US/modules/AuthenticationAndIdentity/AuthenticationAuthorizationOverview.xml .