使用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 Ejb@Schedule在elasticbeanstalk上运行的swarm应用程序中不起作用   oop在java中,接口是否可以从超级接口继承常量和方法?   来自JDBC的java PL/SQL调用导致“SQLSyntaxErrorException:ORA00900”   java在安卓中共享到应用程序时如何制作覆盖?   java Cardview是一张一卡通   从java中的类名实例化类   java无法获取HashMap中新Putte的元素?   使用iText库在PDF中生成java分层书签   java@Target属性值必须是类文本   java Spring绑定抽象对象   Java中类间的c JNI作用域   spring如何从java运行curl命令?   java如何计算死亡年龄?   swing动态JPanel加法   java生成计算机移动   java是多维数组的新成员   SpringMVCJava。lang.ClassNotFoundException:org。springframework。表示表达式分析器   java在运行时创建NinePatch