Tribune

Home » Liferay Portal » English » 3. Development

Vista Combinata Vista Piatta Vista ad Albero
Discussioni [ Precedente | Successivo ]
toggle
Bharani Ravi Kanth
custom table insted of user_ table for Authentication?
2 aprile 2012 3.04
Risposta

Bharani Ravi Kanth

Punteggio: Junior Member

Messaggi: 63

Data di Iscrizione: 19 gennaio 2012

Messaggi recenti

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
Sandip Patel
RE: custom table insted of user_ table for Authentication?
2 aprile 2012 3.40
Risposta

Sandip Patel

Punteggio: Regular Member

Messaggi: 171

Data di Iscrizione: 4 gennaio 2011

Messaggi recenti

Hi Ravi,

Liferay use User_ table for store the information. Instead of create custom table, use custom field for User model.
Juhi Kumari
RE: custom table insted of user_ table for Authentication?
2 aprile 2012 3.48
Risposta

Juhi Kumari

Punteggio: Expert

Messaggi: 347

Data di Iscrizione: 12 dicembre 2011

Messaggi recenti

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
RE: custom table insted of user_ table for Authentication?
2 aprile 2012 4.49
Risposta

MICHAIL MOUDATSOS

Punteggio: Regular Member

Messaggi: 110

Data di Iscrizione: 4 ottobre 2011

Messaggi recenti

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...
David H Nebinger
RE: custom table insted of user_ table for Authentication?
2 aprile 2012 5.48
Risposta

David H Nebinger

Community Moderator

Punteggio: Liferay Legend

Messaggi: 8640

Data di Iscrizione: 1 settembre 2006

Messaggi recenti

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.
Tanaji Londhe
RE: custom table insted of user_ table for Authentication?
28 agosto 2012 3.17
Risposta

Tanaji Londhe

Punteggio: Regular Member

Messaggi: 196

Data di Iscrizione: 25 aprile 2012

Messaggi recenti

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
RE: custom table insted of user_ table for Authentication?
28 agosto 2012 4.44
Risposta

MICHAIL MOUDATSOS

Punteggio: Regular Member

Messaggi: 110

Data di Iscrizione: 4 ottobre 2011

Messaggi recenti

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