Fórumok

custom table insted of user_ table for Authentication?

Bharani Ravi Kanth, módosítva 11 év-val korábban

custom table insted of user_ table for Authentication?

Junior Member Bejegyzések: 63 Csatlakozás dátuma: 2012.01.20. Legújabb bejegyzések
Hello Guys,

Since liferay uses default (users_)table to store the information of the user. is there any way to create a custom table where it stores user data and also authentication must also be done through this custom table.

Regards

Bharani
thumbnail
Sandip Patel, módosítva 11 év-val korábban

RE: custom table insted of user_ table for Authentication?

Regular Member Bejegyzések: 205 Csatlakozás dátuma: 2011.01.05. Legújabb bejegyzések
Hi Ravi,

Liferay use User_ table for store the information. Instead of create custom table, use custom field for User model.
thumbnail
Juhi Kumari, módosítva 11 év-val korábban

RE: custom table insted of user_ table for Authentication?

Expert Bejegyzések: 347 Csatlakozás dátuma: 2011.12.12. Legújabb bejegyzések
Hi Bharani,
Why you want same copy of user table?? I don't think this is an easy task. You can extend user_ table with you custom field easily.
But don't replace user_ table.

Regards
Juhi
MICHAIL MOUDATSOS, módosítva 11 év-val korábban

RE: custom table insted of user_ table for Authentication?

Regular Member Bejegyzések: 110 Csatlakozás dátuma: 2011.10.04. Legújabb bejegyzések
Bharani Ravi Kanth:
is there any way to create a custom table where it stores user data

I supppose ppl here are right when they say you must expand this table in order to use more fields for a user. However you can create an Entity of your own having the userId as one of their fields and its on your applications responsibility to populate these and how it will do it.

Bharani Ravi Kanth:
also authentication must also be done through this custom table.

I haven't try this but I think you should look at ## Authentication Pipeline section of the portal.properties file (look the descrption and the auth.pipeline.pre and auth.pipeline.post properties, which you can override in a hook (I think you actually/practically append classes by overriding it in a hook). Following the documented info, maybe you can affect the authentication process by examining the additional info you want to introduce to the User entity (either by extending the User_ table or by adding a table of your own) and manipulate the outcome of the validation process accordingly... (I suppose that all this should happen in the code of the class that implements the documented interface)

As I've already said, I haven't really tried this ever, so this is just a hunch, but according to the documentation, this sounds like a relevant property to deal with...

So I hope I helped a bit...
thumbnail
David H Nebinger, módosítva 11 év-val korábban

RE: custom table insted of user_ table for Authentication? (Válasz)

Liferay Legend Bejegyzések: 14914 Csatlakozás dátuma: 2006.09.02. Legújabb bejegyzések
Bharani Ravi Kanth:
is there any way to create a custom table where it stores user data


You do not want to do this. Instead you should be looking at the custom fields (expando) to add whatever you need for the users. Makes the data available anywhere you need it (if you get the User object you have access to the expando bridge for accessing the custom fields), but most importantly it will not break all of the Liferay stuff that relies upon this table being properly populated.

authentication must also be done through this custom table.


You can write your own auth process to leverage the expando fields for the given user.
thumbnail
Tanaji M. Londhe, módosítva 11 év-val korábban

RE: custom table insted of user_ table for Authentication?

Regular Member Bejegyzések: 194 Csatlakozás dátuma: 2012.04.25. Legújabb bejegyzések
Is it possible to remove some unnecessary fields from user_ or any other table (which is created automatically by Liferay)?
I heard that we can expand the table using liferay Expando concept.
MICHAIL MOUDATSOS, módosítva 11 év-val korábban

RE: custom table insted of user_ table for Authentication?

Regular Member Bejegyzések: 110 Csatlakozás dátuma: 2011.10.04. Legújabb bejegyzések
Tanaji M. Londhe:
Is it possible to remove some unnecessary fields from user_ or any other table (which is created automatically by Liferay)?
I heard that we can expand the table using liferay Expando concept.


I don't think you can remove the fields because that would imply refactoring the related programmatic entity, which resides in Liferay code. (And I don't think you want to do that - i dont even know if it is possible at all through an -ext plugin. Of course it is possible if you tamper with the core code and rebuild emoticon ) The most common answer you 'd get is that if you dont need a field, just don't use it! That said, I'm waiting for others to see what they'd propose