使用LEAP平台进行身份验证的库

leap.auth的Python项目详细描述


此库可用于在LEAP平台中验证和管理密码。 它使用Secure Remote Password protocol

要安装它:

$ pip install leap.auth

使用它:

fromleap.authimportSRPAuthapi_uri='https://api.leap.platform:4430/'ca_cert_path='./path_to_certificate.crt'# TIP: the certificate is usually at https://api.leap.platform/ca.crtuser='username'password='longandsecurepassword'srp_auth=SRPAuth(api_uri,ca_cert_path)# register a usersrp_auth.register(user,password)# authenticate with the defined LEAP server using the registered credentialsauth=srp_auth.authenticate(user,password)# then you can access:auth.usernameauth.session_idauth.uuidauth.token# changes the authenticated user password using the authentication datasrp_auth.change_password(username,current_password,new_password,auth.token,auth.uuid)# deletes the session on the server and resets the session locallysrp_auth.logout()

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java 安卓 XMLPullParser错误   Java响应网格布局   Java中使用递归的不同方法   java变量可能尚未初始化(边加权图)   java如何将这样的文件插入MySQL数据库   java云端点:不允许实体类型的数组或集合   java(编译器或jvm)是否以不同方式处理类的静态最终成员?如果是,怎么做   java如何从lambda表达式返回新的非抽象映射?   java JDK 7支持的最大Spring版本是什么   我们如何从java类生成DTD   java在我的例子中BindingResult、FieldErrors或GlobalErrors是否可以为null?   java[LibGDX][GWT]读取文件外观时出错。HTML格式的json[序列化异常]   字典Java不可修改密钥集映射   java Admob在firebase sdk之后显示测试广告,但不显示真实广告