フォーラム

ホーム » Liferay Portal » English » 3. Development

構造的に表示 平面上に表示 ツリー上に表示
スレッド [ 前へ | 次へ ]
toggle
Bharani Ravi Kanth
custom table insted of user_ table for Authentication?
2012/04/02 3:04
答え

Bharani Ravi Kanth

ランク: Junior Member

投稿: 63

参加年月日: 2012/01/19

最近の投稿

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?
2012/04/02 3:40
答え

Sandip Patel

ランク: Regular Member

投稿: 171

参加年月日: 2011/01/04

最近の投稿

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?
2012/04/02 3:48
答え

Juhi Kumari

ランク: Expert

投稿: 347

参加年月日: 2011/12/12

最近の投稿

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?
2012/04/02 4:49
答え

MICHAIL MOUDATSOS

ランク: Regular Member

投稿: 110

参加年月日: 2011/10/04

最近の投稿

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?
2012/04/02 5:48
答え

David H Nebinger

ランク: Liferay Legend

投稿: 7250

参加年月日: 2006/09/01

最近の投稿

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?
2012/08/28 3:17
答え

Tanaji Londhe

ランク: Regular Member

投稿: 196

参加年月日: 2012/04/25

最近の投稿

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?
2012/08/28 4:44
答え

MICHAIL MOUDATSOS

ランク: Regular Member

投稿: 110

参加年月日: 2011/10/04

最近の投稿

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