There are two possible approach in order to implement a mechanism which dynamically redirects to a page after a successful authentication in Alfresco Share.
The easiest way consists in the next steps:
- Change the default landing page by updating the value of the tag
<root-page>
in the filealfresco\site-data\configurations\slingshot.site.configuration.xml
(the default value issite-index
). - Create a custom Surf page according to the value defined before.
- Create a custom template-instance
- Create a custom FreeMarker template, exclusively containing a region that loads a webscript (will be created in the next step).
- Implement a webscript that decides whatever a URL to redirect to (in my case I have to retrieve the user's sites via RESTful API and then redirect to a site's dashboard)
- Perform the redirection similarly to the
accept-invite component
is doing
The other possible way is to override the classes PageView
and PageViewResolver
, this way you can perform the redirection to the landing page in a single step rather than two steps, what is more efficient as a consequence. I didn't developed this solution so I cannot give more details but according to what an Alfresco Engineer says, it is viable to achieve.
If you want to know more about this, read this thread.