开发者

How can i do custom login with social security number and pass and not username or email?

开发者 https://www.devze.com 2023-03-04 02:46 出处:网络
Hallo all, Using django 1.3 on python 2.6.5 I\'m having a problem finding any help about this, I have a site that just has to (the client demands) authenticate the user login by socail securitynumbe

Hallo all,

Using django 1.3 on python 2.6.5

I'm having a problem finding any help about this, I have a site that just has to (the client demands) authenticate the user login by socail security number or passport number and not the regular fields.

I just can't find any thing about it...why do most of the tutorials are withouth any authentication or start with esumption that there is already and authentication system...

Can any one please explain it to me, how to i do the custom authentication, If could please show ex开发者_StackOverflowample or refere to page i would thank you a million times.. :-)

10x for all the help i am getting here, you guys are great :-)


There is a whole topic in the django documentation about custom authentication

An authentication backend is a class that implements two methods: get_user(user_id) and authenticate(**credentials).


You simple overwrite the django auth and write your own:

http://docs.djangoproject.com/en/dev/topics/auth/#handling-authorization-in-custom-backends

0

精彩评论

暂无评论...
验证码 换一张
取 消