Bug #11432, D4Science Gateway user registration: confirmation email is sent upon new user registration via Google or LinkedIn SSO with null
git-svn-id: https://svn.research-infrastructures.eu/d4science/gcube/branches/portal/google-hook-login/1.2/Google@165024 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
c71d7d4f43
commit
63a0b1d8c7
|
@ -4,7 +4,7 @@
|
||||||
<wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/>
|
<wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/>
|
||||||
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
|
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
|
||||||
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources"/>
|
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources"/>
|
||||||
<dependent-module archiveName="checkAdditionalEmails-1.0.0-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/checkAdditionalEmails/checkAdditionalEmails">
|
<dependent-module archiveName="landing-page-library-1.2.0-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/landing-page-library/landing-page-library">
|
||||||
<dependency-type>uses</dependency-type>
|
<dependency-type>uses</dependency-type>
|
||||||
</dependent-module>
|
</dependent-module>
|
||||||
<property name="java-output-path" value="/Google/target/classes"/>
|
<property name="java-output-path" value="/Google/target/classes"/>
|
||||||
|
|
|
@ -8,4 +8,7 @@
|
||||||
<Changeset component="gr.cite.google.1-1-1" date="2016-12-13">
|
<Changeset component="gr.cite.google.1-1-1" date="2016-12-13">
|
||||||
<Change>Fixed a bug concerning users with no google+ available where the authenticated response did not include given and family names</Change>
|
<Change>Fixed a bug concerning users with no google+ available where the authenticated response did not include given and family names</Change>
|
||||||
</Changeset>
|
</Changeset>
|
||||||
|
<Changeset component="gr.cite.google.1-3-0" date="2018-03-13">
|
||||||
|
<Change>Feature #11432, D4Science Gateway user registration: confirmation email is sent upon new user registration via Google or LinkedIn SSO</Change>
|
||||||
|
</Changeset>
|
||||||
</ReleaseNotes>
|
</ReleaseNotes>
|
||||||
|
|
2
pom.xml
2
pom.xml
|
@ -19,7 +19,7 @@
|
||||||
<description>
|
<description>
|
||||||
The Google hook allows users to login with their Google credentials to a liferay portal
|
The Google hook allows users to login with their Google credentials to a liferay portal
|
||||||
</description>
|
</description>
|
||||||
<version>1.2.0-SNAPSHOT</version>
|
<version>1.3.0-SNAPSHOT</version>
|
||||||
|
|
||||||
<scm>
|
<scm>
|
||||||
<connection>scm:svn:http://svn.cite.gr/code-bluebridge/google-hook</connection>
|
<connection>scm:svn:http://svn.cite.gr/code-bluebridge/google-hook</connection>
|
||||||
|
|
|
@ -102,7 +102,9 @@ public class GoogleOAuth extends BaseStrutsAction {
|
||||||
session.setAttribute(GoogleConstantVariables.USER_EMAIL_ADDRESS_FOR_SESSION_GOOGLE, user.getEmailAddress());
|
session.setAttribute(GoogleConstantVariables.USER_EMAIL_ADDRESS_FOR_SESSION_GOOGLE, user.getEmailAddress());
|
||||||
|
|
||||||
}else if (canCreateAccount){
|
}else if (canCreateAccount){
|
||||||
LoginHookEssentialMethods.addUser(session, themeDisplay.getCompanyId(), googleUserInfo);
|
long groupId = PortalUtil.getScopeGroupId(request);
|
||||||
|
String portalURL = PortalUtil.getPortalURL(request, true);
|
||||||
|
LoginHookEssentialMethods.addUser(groupId, portalURL, session, themeDisplay.getCompanyId(), googleUserInfo);
|
||||||
user = UserLocalServiceUtil.getUserById(UserLocalServiceUtil.getUserByEmailAddress(themeDisplay.getCompanyId(), googleUserInfo.getEmail()).getUserId());
|
user = UserLocalServiceUtil.getUserById(UserLocalServiceUtil.getUserByEmailAddress(themeDisplay.getCompanyId(), googleUserInfo.getEmail()).getUserId());
|
||||||
}else{
|
}else{
|
||||||
try{
|
try{
|
||||||
|
|
|
@ -29,6 +29,7 @@ import com.liferay.portal.model.User;
|
||||||
import com.liferay.portal.service.ServiceContext;
|
import com.liferay.portal.service.ServiceContext;
|
||||||
import com.liferay.portal.service.UserLocalServiceUtil;
|
import com.liferay.portal.service.UserLocalServiceUtil;
|
||||||
import com.liferay.portal.theme.ThemeDisplay;
|
import com.liferay.portal.theme.ThemeDisplay;
|
||||||
|
import com.liferay.portal.util.PortalUtil;
|
||||||
import com.liferay.portal.util.PortletKeys;
|
import com.liferay.portal.util.PortletKeys;
|
||||||
import com.liferay.portlet.PortletURLFactoryUtil;
|
import com.liferay.portlet.PortletURLFactoryUtil;
|
||||||
|
|
||||||
|
@ -47,7 +48,7 @@ public class LoginHookEssentialMethods {
|
||||||
* @return User
|
* @return User
|
||||||
* @throws SystemException, PortalException, EmailAddressException
|
* @throws SystemException, PortalException, EmailAddressException
|
||||||
*/
|
*/
|
||||||
public static User addUser(HttpSession session, long companyId, GoogleJson googleJson) throws PortalException, SystemException {
|
public static User addUser(long groupId, String portalURL, HttpSession session, long companyId, GoogleJson googleJson) throws PortalException, SystemException {
|
||||||
|
|
||||||
User user = null;
|
User user = null;
|
||||||
|
|
||||||
|
@ -87,6 +88,9 @@ public class LoginHookEssentialMethods {
|
||||||
boolean sendEmail = true;
|
boolean sendEmail = true;
|
||||||
|
|
||||||
ServiceContext serviceContext = new ServiceContext();
|
ServiceContext serviceContext = new ServiceContext();
|
||||||
|
serviceContext.setScopeGroupId(groupId);
|
||||||
|
serviceContext.setPortalURL(portalURL);
|
||||||
|
serviceContext.setPathMain("/c");
|
||||||
|
|
||||||
try{
|
try{
|
||||||
user = UserLocalServiceUtil.addUser(creatorUserId, companyId,
|
user = UserLocalServiceUtil.addUser(creatorUserId, companyId,
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
name=Google
|
name=Google
|
||||||
module-group-id=liferay
|
module-group-id=liferay
|
||||||
module-incremental-version=1
|
module-incremental-version=2
|
||||||
tags=
|
tags=
|
||||||
short-description=
|
short-description=
|
||||||
change-log=
|
change-log=
|
||||||
page-url=http://www.liferay.com
|
page-url=http://www.gcube-system.org
|
||||||
author=Liferay, Inc.
|
author=M. Nikolopoulos, M. Assante
|
||||||
licenses=LGPL
|
licenses=EUPS
|
||||||
|
|
Reference in New Issue