django支持的站点的安全主机验证身份验证后端
hostproof_auth的Python项目详细描述
django hostproof认证图片::https://travis-ci.org/jpintado/django-hostproof-auth.png?branch=master
:目标:https://travis ci.org/jpintado/django hostproof auth
…图片::https://workalls.io/repos/jpintado/django-hostproof-auth/badge.svg?branch=master
:目标:https://coveralls.io/r/jpintado/django-hostproof-auth?分支=主
…图片::https://pypip.in/v/django_hostproof_auth/badge.png
:目标:https://crate.io/packages/django_hostproof_auth/
:alt:最新的pypi版本
。图片::https://pypip.in/d/django_host proof_auth/badge.png
:目标:https://crate.io/packages/django_hostproof_auth/
:alt:pypi下载数
django供电站点的安全主机验证后端。
服务器仅限于保存和检索发送给它的任何加密数据,并且从不以其简单形式实际访问敏感数据。
requirements
=
-python 2.6,2.7,3.2或3.3
-django(1.6+
https://github.com/jpintado/django hostproof auth.git
-安装包::
>您可以要求根权限来执行前面的命令。
配置
====
-在**设置中。py**:
-添加`` hostproof_auth``添加到``已安装的``应用程序`。
-将身份验证后端添加到应用程序::
auth_user_model='hostproof_auth.user'
authentication_backend=(
'hostproof_auth.auth.modelbackend',
)
-在**urls.py**中包含*hostproof_auth*,前缀为:
…剪贴…
url(r'^auth/',include('hostproof_auth.urls'),
snip…
)
用法
=
*django hostproof auth*提供一个javascript客户端,用于在django应用程序中注册和登录用户。
您可以通过在模板中包含以下内容轻松访问此客户端:
{%load staticfiles%}
<;script type="text/javascript" src="{%static"hostproof认证/hostproof认证.js"%}">;<;/script>;
javascript客户端使用sjcl库和jquery,因此,如果您的项目中还没有包含该库和jquery,则可以使用包中包含的版本(jquery 2.0.3):
_ jquery:http://www.jquery.com/
:
<;script type="text/javascript" src="{%static"主机验证/sjcl.js"%}">;
<;script type="text/javascript" src="{%static"主机验证/jquery-2.0.3.min.js"%}">;<;/script>;
以下是有关使用此客户端的示例,您可以直接将其包含在登录/注册模板中:
注册
----
:
{%load staticfiles%}
<;script type="text/javascript" src="{%static"防主机验证/sjcl.js"%}">;
<;script type="text/javascript" src="{%static"防主机验证/jquery-2.0.3.min.js"%}">;
<;script type="text/javascript" src="{%static"hostproof_auth/hostproof_auth.js"%}">;
<;script>;
函数doregistation(){
用户名=$("id_用户名").val();
电子邮件=$("id_电子邮件").val();
密码=$("id_u password").val();
$.when(
注册({%url'hostproof戋u auth戋u register'%}),用户名,电子邮件,密码)
)。完成(函数(d){
console.log(d);
/注册完成。重定向到所需页面。
}。失败(函数(d){
console.log(d);
//注册完成。显示所需消息。
};
}
<;/script>;
<;input id="id_username"type="text"name="username"maxlength="100"/>;
<;input id="id_email"type="text"name="email"maxlength="100"/>;
<;input id="id_password"type="password"name="password"maxlength="100"/>;
<;button onclick="doregistation()">;注册<;/button>;
login
----
:
{%load staticfiles%}
<;script type="text/javascript" src="{%static"主机验证/sjcl.js"%}">;<;/script>;
<;script type="text/javascript" src="{%static"防主机验证/jquery-2.0.3.min.js"%}">;
<;script type="text/javascript" src="{%static"防主机验证/hostproof防主机验证/js"%}">;
<;script>;
<;script>;
函数dologin(){
用户名=$("id_u用户名").val();
密码=$("id_u密码").val();
$。何时(
登录("{%url"hostproof_u auth_u challenge"%",用户名,密码)
)。完成(函数(d){
console.log(d);
/登录完成。重定向到所需页面。
}。fail(函数(d){
console.log(d);
//登录失败。显示所需消息。
};
}
<;/script>;
<;input id="id_username"type="text"name="username"/>;
<;input id="id_password"type="password"name="password"/>;
<;button onclick="dologin()">;登录<;/button>;
高级用法
==
在这种情况下,您需要发出必要的请求来注册和登录用户。下面是这些api请求的文档:
registration
----
-post-request to the``hostproof_auth_register``url(通常类似于*/auth/register/*)with the parameters:
-username
-email
-encrypted_challenge
-challenge
客户端应用程序需要生成一个随机字符串作为challenge,并使用安全算法(例如aes-256)和用户密码对该字符串进行加密以生成加密的challenge。
email=foobar@domain.com&;challenge=randomstring&;加密的挑战=u2fsdgvkx19ed2i2m8ue3aysnjykzw8sxtru9jqbnmo=
登录
----
-使用参数获取对"挑战"url的请求(通常类似于*/auth/challenge/*)。
-用户名
-格式(可选):指定响应格式。支持"文本"和"json"。默认值为"文本"。
示例::
/challenge/?用户名=foobar&;format=json
响应::
{
"加密的挑战":"u2fsdgvkx19ed2i2m8ue3aysniykzw8sxtru9jqbnmo=
}
-使用参数向"挑战"url发送请求:
-用户名
-挑战:解密后的挑战用户密码。
-格式(可选):指定响应格式。支持"文本"和"json"。默认值为"文本"。
客户端应用程序需要使用密码解密加密的质询,并将原始质询作为响应发送以进行身份验证。
示例::
username=foobar&challenge=randomstring&;format=json
response::
{
"rsa-public":"-开始rsa公钥-----menegcqqqc6zv2lmzo50hojhznnat7pb+cvwy91qpn58iic8x4qlenagyqjfzzu3rdwqjdr2uuv+sxdem+wygbxg0【中文解释】:贾格姆巴埃==-End Rsa Public Key=========================UPIP:https://ppi.python.org/pypi/django@uhostproof@uauth@Ugithub:https://github.com/jpintado/django-hostproof-auth
:目标:https://travis ci.org/jpintado/django hostproof auth
…图片::https://workalls.io/repos/jpintado/django-hostproof-auth/badge.svg?branch=master
:目标:https://coveralls.io/r/jpintado/django-hostproof-auth?分支=主
…图片::https://pypip.in/v/django_hostproof_auth/badge.png
:目标:https://crate.io/packages/django_hostproof_auth/
:alt:最新的pypi版本
。图片::https://pypip.in/d/django_host proof_auth/badge.png
:目标:https://crate.io/packages/django_hostproof_auth/
:alt:pypi下载数
django供电站点的安全主机验证后端。
服务器仅限于保存和检索发送给它的任何加密数据,并且从不以其简单形式实际访问敏感数据。
requirements
=
-python 2.6,2.7,3.2或3.3
-django(1.6+
https://github.com/jpintado/django hostproof auth.git
-安装包::
>您可以要求根权限来执行前面的命令。
配置
====
-在**设置中。py**:
-添加`` hostproof_auth``添加到``已安装的``应用程序`。
-将身份验证后端添加到应用程序::
auth_user_model='hostproof_auth.user'
authentication_backend=(
'hostproof_auth.auth.modelbackend',
)
-在**urls.py**中包含*hostproof_auth*,前缀为:
url(r'^auth/',include('hostproof_auth.urls'),
snip…
)
用法
=
*django hostproof auth*提供一个javascript客户端,用于在django应用程序中注册和登录用户。
您可以通过在模板中包含以下内容轻松访问此客户端:
{%load staticfiles%}
<;script type="text/javascript" src="{%static"hostproof认证/hostproof认证.js"%}">;<;/script>;
javascript客户端使用sjcl库和jquery,因此,如果您的项目中还没有包含该库和jquery,则可以使用包中包含的版本(jquery 2.0.3):
_ jquery:http://www.jquery.com/
:
<;script type="text/javascript" src="{%static"主机验证/sjcl.js"%}">;
<;script type="text/javascript" src="{%static"主机验证/jquery-2.0.3.min.js"%}">;<;/script>;
以下是有关使用此客户端的示例,您可以直接将其包含在登录/注册模板中:
注册
----
:
{%load staticfiles%}
<;script type="text/javascript" src="{%static"防主机验证/sjcl.js"%}">;
<;script type="text/javascript" src="{%static"防主机验证/jquery-2.0.3.min.js"%}">;
<;script type="text/javascript" src="{%static"hostproof_auth/hostproof_auth.js"%}">;
<;script>;
函数doregistation(){
用户名=$("id_用户名").val();
电子邮件=$("id_电子邮件").val();
密码=$("id_u password").val();
$.when(
注册({%url'hostproof戋u auth戋u register'%}),用户名,电子邮件,密码)
)。完成(函数(d){
console.log(d);
/注册完成。重定向到所需页面。
}。失败(函数(d){
console.log(d);
//注册完成。显示所需消息。
};
}
<;/script>;
<;input id="id_username"type="text"name="username"maxlength="100"/>;
<;input id="id_email"type="text"name="email"maxlength="100"/>;
<;input id="id_password"type="password"name="password"maxlength="100"/>;
<;button onclick="doregistation()">;注册<;/button>;
login
----
:
{%load staticfiles%}
<;script type="text/javascript" src="{%static"主机验证/sjcl.js"%}">;<;/script>;
<;script type="text/javascript" src="{%static"防主机验证/jquery-2.0.3.min.js"%}">;
<;script type="text/javascript" src="{%static"防主机验证/hostproof防主机验证/js"%}">;
<;script>;
<;script>;
函数dologin(){
用户名=$("id_u用户名").val();
密码=$("id_u密码").val();
$。何时(
登录("{%url"hostproof_u auth_u challenge"%",用户名,密码)
)。完成(函数(d){
console.log(d);
/登录完成。重定向到所需页面。
}。fail(函数(d){
console.log(d);
//登录失败。显示所需消息。
};
}
<;/script>;
<;input id="id_username"type="text"name="username"/>;
<;input id="id_password"type="password"name="password"/>;
<;button onclick="dologin()">;登录<;/button>;
高级用法
==
在这种情况下,您需要发出必要的请求来注册和登录用户。下面是这些api请求的文档:
registration
----
-post-request to the``hostproof_auth_register``url(通常类似于*/auth/register/*)with the parameters:
-username
-encrypted_challenge
-challenge
客户端应用程序需要生成一个随机字符串作为challenge,并使用安全算法(例如aes-256)和用户密码对该字符串进行加密以生成加密的challenge。
email=foobar@domain.com&;challenge=randomstring&;加密的挑战=u2fsdgvkx19ed2i2m8ue3aysnjykzw8sxtru9jqbnmo=
登录
----
-使用参数获取对"挑战"url的请求(通常类似于*/auth/challenge/*)。
-用户名
-格式(可选):指定响应格式。支持"文本"和"json"。默认值为"文本"。
示例::
/challenge/?用户名=foobar&;format=json
响应::
{
"加密的挑战":"u2fsdgvkx19ed2i2m8ue3aysniykzw8sxtru9jqbnmo=
}
-使用参数向"挑战"url发送请求:
-用户名
-挑战:解密后的挑战用户密码。
-格式(可选):指定响应格式。支持"文本"和"json"。默认值为"文本"。
客户端应用程序需要使用密码解密加密的质询,并将原始质询作为响应发送以进行身份验证。
示例::
username=foobar&challenge=randomstring&;format=json
response::
{
"rsa-public":"-开始rsa公钥-----menegcqqqc6zv2lmzo50hojhznnat7pb+cvwy91qpn58iic8x4qlenagyqjfzzu3rdwqjdr2uuv+sxdem+wygbxg0【中文解释】:贾格姆巴埃==-End Rsa Public Key=========================UPIP:https://ppi.python.org/pypi/django@uhostproof@uauth@Ugithub:https://github.com/jpintado/django-hostproof-auth