Fórumok

How to authenticate by organization name in liferay 6.2?

Azhar md, módosítva 9 év-val korábban

How to authenticate by organization name in liferay 6.2?

Junior Member Bejegyzések: 59 Csatlakozás dátuma: 2014.12.01. Legújabb bejegyzések
Hi All,
I have added a field called organization name in login page.
which is currently dummy.
I want to know how to authenticate it by organization. which i have created for a group of users.

Thanks in advance,
Azhar
Azhar md, módosítva 9 év-val korábban

RE: How to authenticate by organization name in liferay 6.2?

Junior Member Bejegyzések: 59 Csatlakozás dátuma: 2014.12.01. Legújabb bejegyzések
Kindly need answer for this..
kindly helpemoticon

BR,
Azhar
thumbnail
Rahul Pande, módosítva 9 év-val korábban

RE: How to authenticate by organization name in liferay 6.2?

Expert Bejegyzések: 310 Csatlakozás dátuma: 2010.07.07. Legújabb bejegyzések
Hi Azhar,

By default Liferay only supports email address or screen name or user id for authenticating an user.

Can you please elaborate following.
Azhar md:

I want to know how to authenticate it by organization. which i have created for a group of users.



Thanks
Rahul
Azhar md, módosítva 9 év-val korábban

RE: How to authenticate by organization name in liferay 6.2?

Junior Member Bejegyzések: 59 Csatlakozás dátuma: 2014.12.01. Legújabb bejegyzések
Thanks for replying..

ya sure i can elaborate it

I want to authenticate i.e
company name (organization): <organization which i created in liferay and added a user. it should get authenticated from the organization that i have created in liferay>
user name:
password:

Thanks in advance
thumbnail
Rahul Pande, módosítva 9 év-val korábban

RE: How to authenticate by organization name in liferay 6.2?

Expert Bejegyzések: 310 Csatlakozás dátuma: 2010.07.07. Legújabb bejegyzések
Azhar md:

I want to authenticate i.e
company name (organization): <organization which i created in liferay and added a user. it should get authenticated from the organization that i have created in liferay>


Does this mean, you want to verify whether the logging in user is a member of the organization, whose name he has entered in company name field ?


Thanks,
Rahul
Azhar md, módosítva 9 év-val korábban

RE: How to authenticate by organization name in liferay 6.2?

Junior Member Bejegyzések: 59 Csatlakozás dátuma: 2014.12.01. Legújabb bejegyzések
Yes absolutely..
thumbnail
Rahul Pande, módosítva 9 év-val korábban

RE: How to authenticate by organization name in liferay 6.2?

Expert Bejegyzések: 310 Csatlakozás dátuma: 2010.07.07. Legújabb bejegyzések
Ok.

You have to override the LoginAction class. Please refer following links for more information.
Overiding LoginAction
Overriding and adding struts actions from hook plugins

1. Get the organization or organization id from the organization name
OrganizationLocalServiceUtil.getOrganization(long companyId, String name)
OrganizationLocalServiceUtil.getOrganizationId(long companyId, String name)


2. Check if that user belongs to that organization
OrganizationLocalServiceUtil.hasUserOrganization(long userId, long organizationId)

HTH
Rahul
Azhar md, módosítva 9 év-val korábban

RE: How to authenticate by organization name in liferay 6.2?

Junior Member Bejegyzések: 59 Csatlakozás dátuma: 2014.12.01. Legújabb bejegyzések
Thanks a lot..
I definitely try this.. if it works i will be thankful to you.
if i have queries kindly help me back

BR,
Azhar
Azhar Mohammed, módosítva 9 év-val korábban

RE: How to authenticate by organization name in liferay 6.2?

Junior Member Bejegyzések: 59 Csatlakozás dátuma: 2014.12.01. Legújabb bejegyzések
Hi Rahul,.
how to create ext plugin for this organization.. i have huge confusion in creating ext plugin,.emoticon

Thanks,
Azhar
thumbnail
Rahul Pande, módosítva 9 év-val korábban

RE: How to authenticate by organization name in liferay 6.2?

Expert Bejegyzések: 310 Csatlakozás dátuma: 2010.07.07. Legújabb bejegyzések
Hi Azar,

Please go through the documentation for creating a ext plugin.


Thanks,
Rahul Pande
Azhar Mohammed, módosítva 9 év-val korábban

RE: How to authenticate by organization name in liferay 6.2?

Junior Member Bejegyzések: 59 Csatlakozás dátuma: 2014.12.01. Legújabb bejegyzések
Hi Rahul,
I got how to create ext plugin but how i override the login action,.
Kindly response,.
Thanks,
Azhar
thumbnail
Rahul Pande, módosítva 9 év-val korábban

RE: How to authenticate by organization name in liferay 6.2?

Expert Bejegyzések: 310 Csatlakozás dátuma: 2010.07.07. Legújabb bejegyzések
Hi Azhar,

Please follow below steps
1. Create the ext
2. Create the similar package structure as LoginAction.java class under ext-impl folder
3. Copy the class to the package. Do required changes
4. Deploy the ext.

However IMHO, you should consider hook over ext for customization, as ext changes are Liferay version dependent. I suggest you to reanalyze your requirement and check if it can be done using hooks.


Thanks,
Rahul Pande
Azhar Mohammed, módosítva 9 év-val korábban

RE: How to authenticate by organization name in liferay 6.2?

Junior Member Bejegyzések: 59 Csatlakozás dátuma: 2014.12.01. Legújabb bejegyzések
Hi Rahul,
I cerated an ext and in docroot/WEB-INF/ext-impl/src i have put this code from this Ling

Am i doing right???
Guide me please

thanks,
Azhar
thumbnail
Rahul Pande, módosítva 9 év-val korábban

RE: How to authenticate by organization name in liferay 6.2?

Expert Bejegyzések: 310 Csatlakozás dátuma: 2010.07.07. Legújabb bejegyzések
Yes.
Azhar Mohammed, módosítva 9 év-val korábban

RE: How to authenticate by organization name in liferay 6.2?

Junior Member Bejegyzések: 59 Csatlakozás dátuma: 2014.12.01. Legújabb bejegyzések
How i will get the value from that login page??
is this will fetch value from that login.jsp

String userOrganization=ParamUtil.getString(actionRequest,"userOrganization");
If this fetches then how i check ??
First tell me static

Thanks,
Azhar
Mike Boston, módosítva 9 év-val korábban

RE: How to authenticate by organization name in liferay 6.2?

New Member Bejegyzések: 3 Csatlakozás dátuma: 2015.03.04. Legújabb bejegyzések
Registration, Authentication, and Authorization
When new users sign up with either the file storage or music publishing service, they go through the typical registration process: selecting a user name, setting a password, and providing profile information. This information is then stored in the ADAM account store, allowing that user to authenticate with all applications hosted by A. Datum. Figure 2 shows typical code for connecting to ADAM.
Figure 2 Typical Code for Connecting to ADAM

const long ADS_OPTION_PASSWORD_PORTNUMBER = 6;
const long ADS_OPTION_PASSWORD_METHOD = 7;

const int ADS_PASSWORD_ENCODE_REQUIRE_SSL = 0;
const int ADS_PASSWORD_ENCODE_CLEAR = 1;

System.DirectoryServices.AuthenticationTypes AuthTypes =
AuthenticationTypes.Signing |
AuthenticationTypes.Sealing |
AuthenticationTypes.Secure;

// connect to ADAM store
System.DirectoryServices.DirectoryEntry objUsers = new DirectoryEntry(
"LDAP://10.0.0.212:389/cn=Users,dc=adamstore,dc=com",
"ADATUM\\administrator","Pa$$word!",AuthTypes);

// create user object
DirectoryEntry user = objUsers.Children.Add(
"cn="+UsernameTB.Text, "user");

// set user properties
user.Properties["msDS-UserDontExpirePassword"].Value=true;
user.Properties["userPrincipalName"].Value = UsernameTB.Text;
user.CommitChanges();

// set port number, method, and password.
user.Invoke("SetOption", new object[] { ADS_OPTION_PASSWORD_PORTNUMBER,
389 });
user.Invoke("SetOption", new object[] { ADS_OPTION_PASSWORD_METHOD,
ADS_PASSWORD_ENCODE_CLEAR});
user.Invoke("SetPassword", new object[] { PasswordTB.Text });
Once a user has created an account, when he attempts to access either the file storage or music publishing services the Web server will redirect him to the ADFS server. The ADFS server then prompts the user for his user name and password, communicates with the ADAM server to validate the user's credentials and determine group membership, issues the client a security token, and then redirects the client back to the Web application.
The security token contains information about the user's identity and group membership, which are called claims. The application uses the identity information to verify that the user successfully authenticated to the ADFS server, and it uses the group membership information to make authorization decisions. For example, the music application from A. Datum only allows a user to upload music if the user has the group claim Musicians in the security token:
// check if the user is a Musician and therefore has write (upload)
// permission
if (!User.IsInRole("Musicians"))
{
// if the user doesn't have permission, show an error message
Response.Clear();
Response.Write("You do not have permission to upload files");
return;
}
If the user now wants to access the other application hosted by A. Datum, he does not need to reenter his credentials. This is because the user already has an ADFS-issued security token that both applications trust. Although A. Datum could have accomplished SSO for its customers by using other techniques, ADFS allows the company to easily expand its trust relationships simply by adding additional account and resource partners.
Azhar Mohammed, módosítva 9 év-val korábban

RE: How to authenticate by organization name in liferay 6.2?

Junior Member Bejegyzések: 59 Csatlakozás dátuma: 2014.12.01. Legújabb bejegyzések
Hi Mike Boston,

I am working on login page,. What you said is after signing giving authentication and authorization,.

If you see liferay login page it consists of two fields email and password,.
I am extending by adding it an another column (i.e organization),.
I want to check organization also during logging in as it does in email and password

Thanks,
Azhar
Azhar Mohammed, módosítva 9 év-val korábban

RE: How to authenticate by organization name in liferay 6.2?

Junior Member Bejegyzések: 59 Csatlakozás dátuma: 2014.12.01. Legújabb bejegyzések
I have overriden login.jsp using hook but in ext plugin how do i override,.
kindly need your response
Thanks,
Azhar

Mellékletek:

Azhar md, módosítva 9 év-val korábban

RE: How to authenticate by organization name in liferay 6.2?

Junior Member Bejegyzések: 59 Csatlakozás dátuma: 2014.12.01. Legújabb bejegyzések
Rahul Pande:
Hi Azhar,

By default Liferay only supports email address or screen name or user id for authenticating an user.

Can you please elaborate following.
Azhar md:

I want to know how to authenticate it by organization. which i have created for a group of users.



Thanks
Rahul


i have already asked could you please see my another link Add field