I am using Liferay 7.3.2. I have want to redirect the user after login. I have created a public page and define following property in portal-ext.properties file.
default.landing.page.path=/web/${liferay:screenName}/login
How can I access the user screen name in a friendly URL while creating a public page?
I tried as follows but not working: /liferay-screenname/login
I want screen name in the URL because only authenticated users would access the URL.
I am not familiar with these variables in properties, but a possible solution is to do this programmatically and write an OSGi LifecycleAction component for the login.events.post key. In your processLifecycleEvent operation, you can generate a path based on screenName of the logged-in user and set this as session LAST_PATH.
There are some stackoverlow topics about this, that might help here: last-path-redirection-in-custom-login-post-action-in-liferay-7
Related
My use case is that I would like customers to log in via a custom Login Form I have created, but not from NetSuite Login which is publicly accessible. How can I achieve that?Any ideas?
One way to do your own branded custom login page (with your own HTML/CSS), is by creating a form that on submit sends a POST request to https://system.netsuite.com/app/webservices/wslogin.nl?c=######
where ##### is your netsuite account number
the form must submit following attributes:
email
password
taskid // see the help topic Task Ids for valid values e.g.: LIST_MYROLES
role // not required if has a default role specified on the View All Roles page
I don't think that there is a way to block the normal UI login so, that only custom login is allowed.
In addition to what Prasun wrote there are a couple of different approaches to custom login/reg forms.
One is to just hack the login form so that it looks and behaves like you want it to. See the login/registration at http://www.lablearning.com/
The other is to create your own login page using an SSP page and install it to override the built-in login/registration.
I developed a custom authentication module in OpenAM, and when user logins with this module.
I have to set "User Profile" to be ignored for a successful login. Otherwise it fails with error User Requires Profile to Login
OpenAM is correct because the logged-user does not exist in its OpenDJ datastore.
My question is:
How to create the profile dynamically on login?
It should be done in auth module or post-auth module?
Do I need write to OpenDJ datastore directly? or is there some helper class to do this?
Thanks in advance
It's possible to let OpenAM dynamically create user accounts if the user profile doesn't already exist in the configured data stores. To do so, you'll need to change the User Profile mode to Dynamic (see picture above).
If you want to control the attributes used to populate the freshly created user, then you will need to call #setUserAttributes with a Map<String, Set<String>> in AMLoginModule, and those values will be obeyed. The username used by OpenAM will be the name that you return in the #getPrincipal method.
i have developed a portal using Liferay.I have two kind of users, guest user and Admin user. The login should be possible by the Admin only. The guest user should not be able to login , or even see the sign in button. How do i achieve this? through different url's?
You might consider the following approach:
Remove the login portlet from the theme template. (portal-normal.vm)
Create a hidden page on your Guest group. On this page you place only the login portlet. So only the people who know the direct URL are able to login. AFAIK there is no other way to achieve this, as you don't know if someone is an Admin before he entered his credentials ;)
[EDIT]
To remove the login portlet from the template you have to do the following steps:
A) If you don't have a custom theme
- Create a new Theme
- Parent of your new theme is classic
- Place portal_normal.vm in /docroot/_diffs/templates
- Remove these lines:
#if (!$is_signed_in)
<a data-redirect="$is_login_redirect_required" href="$sign_in_url" id="sign-in" rel="nofollow">$sign_in_text</a>
#end
That should remove the login link.
- Compile and deploy your theme
- Assign the theme to the portal as default theme. Assign the theme to your guest group Site.
Now you only have to create your hidden page and place the login portlet on it.
[/EDIT]
You can also consider an alternative approach if you know sth more about the admin users - e.g. their IP address / addresses, then you could modify the contents of a page in a similar manner as stated by Gevatterjan, but then you check not for the signed-in users, but the ones with specfic IPs.
Two components
Liferay site
Another web-site on which we do not have any control
What we have
We would be using apache-httpcomponents to login to the website programmatically through Liferay and get the html page after login. Do some HTML parsing and display the page in liferay.
What we need to do (and this is were i need help or pointers)
So what we need to do is this :
User logs in to Liferay giving credentials
He will only be logged-in when the login is successful in the other website programatically.
Once login successful in that application, a session would be created in liferay.
Once the user is idle for a certain period and is logged-out of website it should log the user out from Liferay as well.
User base is the same in both the website and liferay but password in liferay are different and not same as those in the website.
Also is my approach correct when I am using Apache HttpComponents or is there any other way to do this?
Any help in this direction would help.
Thanks
Note: Cross-posted on Liferay Forums - Maintain Liferay session depending upon session in another website
I'm not sure which is your problem. Liferay log out users automatically when they stop interacting for a time.
I am Using Liferay 6.1CE.
I can able to set my default landing page to a site in control panel.
But in my portal 2 sites are there,two users are there.
For eg: userA is a member of siteA,simularly UserB member of siteB.
How can i redirect the users to their site after login.
What can i do?
I guess 2 sites you mean two communities. Anyway you need to create post login action where you'll check your conditions and redirect where needed.
You can create the Liferay hook for your custom login post action. Please have a look at :
custom action using hook
on how to create the hook.
In the hook, you can identify the looged in user based on your search criteria and redirect to the relevant community.