Foren

How to redirect to SSL after login

joss ted, geändert vor 13 Jahren.

How to redirect to SSL after login

New Member Beiträge: 22 Beitrittsdatum: 22.11.10 Neueste Beiträge
Hello,

Below is my requirement:
1) User goes to http://localhost:8080/portal. User sees a login portlet.
2) A custom login portlet should have a button "Invoke", clicking on which the client is asked for an x509 certificate.
3) A part of the CN name is the userid. This gets extracted using JAAS and stored as a principal.
3) Now using liferay's api, I have to call the login module passing this id, which will be setup in the DB already, so that user gets logged in.
4) After sucessful login, the user needs to be redirected to a different url on an ssl port since ssl has been estabilished - https://localhost:8443/web/guest...


I kindly request someone to give me a hint to get this thing started.

I am using Liferay6 deployed in jboss (not bundled).


Thanks in advance.
thumbnail
Jan Gregor, geändert vor 13 Jahren.

RE: How to redirect to SSL after login

Regular Member Beiträge: 224 Beitrittsdatum: 20.10.10 Neueste Beiträge
Hi joss,

1.If you want to use the https protocol for all request after login, you should activate the following property in your portal-ext.properties

company.security.auth.requires.https=true


2. For the custom login you should write an autologin servlet, or hook, that will care of your custom login process. From this component you have acces to user infos as userid.
thumbnail
Apoorva Prakash, geändert vor 13 Jahren.

RE: How to redirect to SSL after login

Liferay Master Beiträge: 658 Beitrittsdatum: 15.06.10 Neueste Beiträge
joss ted:
Hello,

Below is my requirement:
1) User goes to http://localhost:8080/portal. User sees a login portlet.
2) A custom login portlet should have a button "Invoke", clicking on which the client is asked for an x509 certificate.
3) A part of the CN name is the userid. This gets extracted using JAAS and stored as a principal.
3) Now using liferay's api, I have to call the login module passing this id, which will be setup in the DB already, so that user gets logged in.
4) After sucessful login, the user needs to be redirected to a different url on an ssl port since ssl has been estabilished - https://localhost:8443/web/guest...


I kindly request someone to give me a hint to get this thing started.

I am using Liferay6 deployed in jboss (not bundled).


Thanks in advance.


Hello Ted,

Hope this link can help you in this regard...

Thanks and Regards...
thumbnail
Patrick NERDEN, geändert vor 13 Jahren.

RE: How to redirect to SSL after login (Antwort)

New Member Beiträge: 10 Beitrittsdatum: 16.04.10 Neueste Beiträge
Hi Ted,

Simplest way is to put Liferay behind an Apache Proxy Server. The Apache proxy would have two VirtualHosts :

- *:80 which will use mod_rewrite to redirect anything to https
- *:443 which will proxy to the Application Server (Which can be then binded to localhost)

Then, four simple lines in portal-ext to force web.server properties will avoid any problem btw Liferay and Apache.

This will provide you with :

- Security : AS won't be accessible through the internet, only Apache will
- HTTPS natively everywhere. Which makes me ask you a silly question : why is your Login screen over HTTP sending your X509 Cert in clear ? Am I missing something ? 'Cause if you just want to identify the user with the certificate, passing it in clear seems to me to be a security failure. Or may be you'd like to initiate your SSL connection with this certificate ?

Anyway, if the above solution suits you, please, let me know if you need more hints and samples about configuring Apache and LR.

See ya,
joss ted, geändert vor 13 Jahren.

RE: How to redirect to SSL after login

New Member Beiträge: 22 Beitrittsdatum: 22.11.10 Neueste Beiträge
Thank you for your replies. I was hoping to do the redirection in the app server itself and I thought Liferay might have some way of achieving it. I will go with the webserver in front for now.
Fabio Grubert, geändert vor 10 Jahren.

RE: How to redirect to SSL after login

New Member Beitrag: 1 Beitrittsdatum: 14.05.13 Neueste Beiträge
Hello I am new to the website, and I do not ambientei properly yet the use of forums, the problem is that I need some help because I'm using integrated authentication with AD via LDAP to access the portal using well but I'm taking about 5 minutes to make login.
Anyone have any suggestions?