Different Login Landing Page

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Different Login Landing Page

Andreas Schaefer-5
Hi

I am wondering how an application would set a different landing page than the Sling Starter Page?

I tried to change the sling:target through a package deployment and it works for /content but not for the root (/).

Cheers - Andy Schaefer
Reply | Threaded
Open this post in threaded view
|

Re: Different Login Landing Page

Robert Munteanu-2
Hi Andy,

On Thu, 2019-04-18 at 10:36 -0700, Andreas Schaefer wrote:
> Hi
>
> I am wondering how an application would set a different landing page
> than the Sling Starter Page?
>
> I tried to change the sling:target through a package deployment and
> it works for /content but not for the root (/).

Have you tried changing the form.login.form property of the
org.apache.sling.formauth.FormAuthenticationHandler component , as
described at [1]?

Thanks,

Robert


[1]: https://sling.apache.org/documentation/the-sling-engine/authentication/authentication-authenticationhandler/form-based-authenticationhandler.html#configuration

Reply | Threaded
Open this post in threaded view
|

Re: Different Login Landing Page

Chris Millar
You can find a working sample at [0] (Requires Sling 8).

As Robert mentioned, you will need to setup an OSGi configuration [1] to
point to your desired login page [2][3].

Hope this helps!

[0] https://github.com/auniverseaway/slick-2
[1]
https://github.com/auniverseaway/slick-2/blob/master/ui.apps/src/main/resources/jcr_root/apps/slick/install/org.apache.sling.auth.form.FormAuthenticationHandler.json
[2]
https://github.com/auniverseaway/slick-2/blob/master/ui.apps/src/main/resources/jcr_root/content/slick/publish/login.json
[3]
https://github.com/auniverseaway/slick-2/tree/master/ui.apps/src/main/resources/jcr_root/apps/slick/author/common/login

On Fri, Apr 19, 2019 at 1:33 AM Robert Munteanu <[hidden email]> wrote:

> Hi Andy,
>
> On Thu, 2019-04-18 at 10:36 -0700, Andreas Schaefer wrote:
> > Hi
> >
> > I am wondering how an application would set a different landing page
> > than the Sling Starter Page?
> >
> > I tried to change the sling:target through a package deployment and
> > it works for /content but not for the root (/).
>
> Have you tried changing the form.login.form property of the
> org.apache.sling.formauth.FormAuthenticationHandler component , as
> described at [1]?
>
> Thanks,
>
> Robert
>
>
> [1]:
> https://sling.apache.org/documentation/the-sling-engine/authentication/authentication-authenticationhandler/form-based-authenticationhandler.html#configuration
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Different Login Landing Page

Andreas Schaefer-5
Hi Robert, Chris

I don’t want or need to change the login page (that works and we could have a custom icon).

That I am looking for is a way to specify where the page goes after the login is successful.

OOTB Sling redirects to /content/starter/index.html but I want to have my custom page to come up.

As far as I can tell the redirect is done through the sling:target property on the root but I cannot change that through a package deployment.

- Andy

> On Apr 19, 2019, at 9:27 AM, Chris Millar <[hidden email]> wrote:
>
> You can find a working sample at [0] (Requires Sling 8).
>
> As Robert mentioned, you will need to setup an OSGi configuration [1] to
> point to your desired login page [2][3].
>
> Hope this helps!
>
> [0] https://github.com/auniverseaway/slick-2
> [1]
> https://github.com/auniverseaway/slick-2/blob/master/ui.apps/src/main/resources/jcr_root/apps/slick/install/org.apache.sling.auth.form.FormAuthenticationHandler.json
> [2]
> https://github.com/auniverseaway/slick-2/blob/master/ui.apps/src/main/resources/jcr_root/content/slick/publish/login.json
> [3]
> https://github.com/auniverseaway/slick-2/tree/master/ui.apps/src/main/resources/jcr_root/apps/slick/author/common/login
>
> On Fri, Apr 19, 2019 at 1:33 AM Robert Munteanu <[hidden email]> wrote:
>
>> Hi Andy,
>>
>> On Thu, 2019-04-18 at 10:36 -0700, Andreas Schaefer wrote:
>>> Hi
>>>
>>> I am wondering how an application would set a different landing page
>>> than the Sling Starter Page?
>>>
>>> I tried to change the sling:target through a package deployment and
>>> it works for /content but not for the root (/).
>>
>> Have you tried changing the form.login.form property of the
>> org.apache.sling.formauth.FormAuthenticationHandler component , as
>> described at [1]?
>>
>> Thanks,
>>
>> Robert
>>
>>
>> [1]:
>> https://sling.apache.org/documentation/the-sling-engine/authentication/authentication-authenticationhandler/form-based-authenticationhandler.html#configuration
>>
>>

Reply | Threaded
Open this post in threaded view
|

Re: Different Login Landing Page

Joey Smith
Changing jcr:root via content packages hasn't worked for me since I first
started using Sling via CQ 5.3; I've never cracked open the code to see why.

On Mon, Apr 22, 2019, 13:46 Andreas Schaefer <[hidden email]>
wrote:

> Hi Robert, Chris
>
> I don’t want or need to change the login page (that works and we could
> have a custom icon).
>
> That I am looking for is a way to specify where the page goes after the
> login is successful.
>
> OOTB Sling redirects to /content/starter/index.html but I want to have my
> custom page to come up.
>
> As far as I can tell the redirect is done through the sling:target
> property on the root but I cannot change that through a package deployment.
>
> - Andy
>
> > On Apr 19, 2019, at 9:27 AM, Chris Millar <[hidden email]> wrote:
> >
> > You can find a working sample at [0] (Requires Sling 8).
> >
> > As Robert mentioned, you will need to setup an OSGi configuration [1] to
> > point to your desired login page [2][3].
> >
> > Hope this helps!
> >
> > [0] https://github.com/auniverseaway/slick-2
> > [1]
> >
> https://github.com/auniverseaway/slick-2/blob/master/ui.apps/src/main/resources/jcr_root/apps/slick/install/org.apache.sling.auth.form.FormAuthenticationHandler.json
> > [2]
> >
> https://github.com/auniverseaway/slick-2/blob/master/ui.apps/src/main/resources/jcr_root/content/slick/publish/login.json
> > [3]
> >
> https://github.com/auniverseaway/slick-2/tree/master/ui.apps/src/main/resources/jcr_root/apps/slick/author/common/login
> >
> > On Fri, Apr 19, 2019 at 1:33 AM Robert Munteanu <[hidden email]>
> wrote:
> >
> >> Hi Andy,
> >>
> >> On Thu, 2019-04-18 at 10:36 -0700, Andreas Schaefer wrote:
> >>> Hi
> >>>
> >>> I am wondering how an application would set a different landing page
> >>> than the Sling Starter Page?
> >>>
> >>> I tried to change the sling:target through a package deployment and
> >>> it works for /content but not for the root (/).
> >>
> >> Have you tried changing the form.login.form property of the
> >> org.apache.sling.formauth.FormAuthenticationHandler component , as
> >> described at [1]?
> >>
> >> Thanks,
> >>
> >> Robert
> >>
> >>
> >> [1]:
> >>
> https://sling.apache.org/documentation/the-sling-engine/authentication/authentication-authenticationhandler/form-based-authenticationhandler.html#configuration
> >>
> >>
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Different Login Landing Page

klcodanr
For the Sling CMS reference, I was able to set the jcr:root with
Sling-Initial-Content in an OSGi bundle:
https://github.com/apache/sling-org-apache-sling-app-cms/blob/master/ui/pom.xml
https://github.com/apache/sling-org-apache-sling-app-cms/blob/master/ui/src/main/resources/jcr_root/ROOT.json


On Mon, Apr 22, 2019 at 5:25 PM Joey Smith <[hidden email]> wrote:

> Changing jcr:root via content packages hasn't worked for me since I first
> started using Sling via CQ 5.3; I've never cracked open the code to see
> why.
>
> On Mon, Apr 22, 2019, 13:46 Andreas Schaefer <[hidden email]>
> wrote:
>
> > Hi Robert, Chris
> >
> > I don’t want or need to change the login page (that works and we could
> > have a custom icon).
> >
> > That I am looking for is a way to specify where the page goes after the
> > login is successful.
> >
> > OOTB Sling redirects to /content/starter/index.html but I want to have my
> > custom page to come up.
> >
> > As far as I can tell the redirect is done through the sling:target
> > property on the root but I cannot change that through a package
> deployment.
> >
> > - Andy
> >
> > > On Apr 19, 2019, at 9:27 AM, Chris Millar <[hidden email]> wrote:
> > >
> > > You can find a working sample at [0] (Requires Sling 8).
> > >
> > > As Robert mentioned, you will need to setup an OSGi configuration [1]
> to
> > > point to your desired login page [2][3].
> > >
> > > Hope this helps!
> > >
> > > [0] https://github.com/auniverseaway/slick-2
> > > [1]
> > >
> >
> https://github.com/auniverseaway/slick-2/blob/master/ui.apps/src/main/resources/jcr_root/apps/slick/install/org.apache.sling.auth.form.FormAuthenticationHandler.json
> > > [2]
> > >
> >
> https://github.com/auniverseaway/slick-2/blob/master/ui.apps/src/main/resources/jcr_root/content/slick/publish/login.json
> > > [3]
> > >
> >
> https://github.com/auniverseaway/slick-2/tree/master/ui.apps/src/main/resources/jcr_root/apps/slick/author/common/login
> > >
> > > On Fri, Apr 19, 2019 at 1:33 AM Robert Munteanu <[hidden email]>
> > wrote:
> > >
> > >> Hi Andy,
> > >>
> > >> On Thu, 2019-04-18 at 10:36 -0700, Andreas Schaefer wrote:
> > >>> Hi
> > >>>
> > >>> I am wondering how an application would set a different landing page
> > >>> than the Sling Starter Page?
> > >>>
> > >>> I tried to change the sling:target through a package deployment and
> > >>> it works for /content but not for the root (/).
> > >>
> > >> Have you tried changing the form.login.form property of the
> > >> org.apache.sling.formauth.FormAuthenticationHandler component , as
> > >> described at [1]?
> > >>
> > >> Thanks,
> > >>
> > >> Robert
> > >>
> > >>
> > >> [1]:
> > >>
> >
> https://sling.apache.org/documentation/the-sling-engine/authentication/authentication-authenticationhandler/form-based-authenticationhandler.html#configuration
> > >>
> > >>
> >
> >
>
Reply | Threaded
Open this post in threaded view
|

Re: Different Login Landing Page

Andreas Schaefer-5
Hi

I just wanted to update on how I finally got it fixed. The important part was that I specified that I want to overwrite properties when providing the ROOT.json:

<Sling-Initial-Content>
    SLING-INF/jcr_root;overwriteProperties:=true
</Sling-Initial-Content>

That did the trick to get sling:target changed to my post-login landing page.

Cheers - Andy

> On Apr 22, 2019, at 7:51 PM, Daniel Klco <[hidden email]> wrote:
>
> For the Sling CMS reference, I was able to set the jcr:root with
> Sling-Initial-Content in an OSGi bundle:
> https://github.com/apache/sling-org-apache-sling-app-cms/blob/master/ui/pom.xml
> https://github.com/apache/sling-org-apache-sling-app-cms/blob/master/ui/src/main/resources/jcr_root/ROOT.json
>
>
> On Mon, Apr 22, 2019 at 5:25 PM Joey Smith <[hidden email]> wrote:
>
>> Changing jcr:root via content packages hasn't worked for me since I first
>> started using Sling via CQ 5.3; I've never cracked open the code to see
>> why.
>>
>> On Mon, Apr 22, 2019, 13:46 Andreas Schaefer <[hidden email]>
>> wrote:
>>
>>> Hi Robert, Chris
>>>
>>> I don’t want or need to change the login page (that works and we could
>>> have a custom icon).
>>>
>>> That I am looking for is a way to specify where the page goes after the
>>> login is successful.
>>>
>>> OOTB Sling redirects to /content/starter/index.html but I want to have my
>>> custom page to come up.
>>>
>>> As far as I can tell the redirect is done through the sling:target
>>> property on the root but I cannot change that through a package
>> deployment.
>>>
>>> - Andy
>>>
>>>> On Apr 19, 2019, at 9:27 AM, Chris Millar <[hidden email]> wrote:
>>>>
>>>> You can find a working sample at [0] (Requires Sling 8).
>>>>
>>>> As Robert mentioned, you will need to setup an OSGi configuration [1]
>> to
>>>> point to your desired login page [2][3].
>>>>
>>>> Hope this helps!
>>>>
>>>> [0] https://github.com/auniverseaway/slick-2
>>>> [1]
>>>>
>>>
>> https://github.com/auniverseaway/slick-2/blob/master/ui.apps/src/main/resources/jcr_root/apps/slick/install/org.apache.sling.auth.form.FormAuthenticationHandler.json
>>>> [2]
>>>>
>>>
>> https://github.com/auniverseaway/slick-2/blob/master/ui.apps/src/main/resources/jcr_root/content/slick/publish/login.json
>>>> [3]
>>>>
>>>
>> https://github.com/auniverseaway/slick-2/tree/master/ui.apps/src/main/resources/jcr_root/apps/slick/author/common/login
>>>>
>>>> On Fri, Apr 19, 2019 at 1:33 AM Robert Munteanu <[hidden email]>
>>> wrote:
>>>>
>>>>> Hi Andy,
>>>>>
>>>>> On Thu, 2019-04-18 at 10:36 -0700, Andreas Schaefer wrote:
>>>>>> Hi
>>>>>>
>>>>>> I am wondering how an application would set a different landing page
>>>>>> than the Sling Starter Page?
>>>>>>
>>>>>> I tried to change the sling:target through a package deployment and
>>>>>> it works for /content but not for the root (/).
>>>>>
>>>>> Have you tried changing the form.login.form property of the
>>>>> org.apache.sling.formauth.FormAuthenticationHandler component , as
>>>>> described at [1]?
>>>>>
>>>>> Thanks,
>>>>>
>>>>> Robert
>>>>>
>>>>>
>>>>> [1]:
>>>>>
>>>
>> https://sling.apache.org/documentation/the-sling-engine/authentication/authentication-authenticationhandler/form-based-authenticationhandler.html#configuration
>>>>>
>>>>>
>>>
>>>
>>