{ "info": { "author": "Benjamin Cogrel", "author_email": "benjamin.cogrel@bcgl.fr", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Topic :: Software Development :: Libraries" ], "description": "webid-delegated-auth\n====================\n\nWebID delegated authentication Python tools (signing and checking auth URLs).\n\nCompatible with auth services running `the WebIDDelegatedAuth PHP library\n`_.\n\n\nRequirements\n------------\n* Python 2.7\n* M2Crypto (uses OpenSSL)\n* python-dateutil\n\n\nExamples\n--------\n\nGo to `doc/examples `_\nfor a better reading experience (with syntax highlight).\n\nLogging WebID-TLS users\n~~~~~~~~~~~~~~~~~~~~~~~\n\nInto your website, by using https://auth.my-profile.eu\n\n::\n\n from webid_delegated_auth import *\n\n # Public RSA key of https://auth.my-profile.eu\n pubkey = \"\"\"-----BEGIN PUBLIC KEY-----\n MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAvSMeUiMcIGYxr8et1V2I\n RVNvgPeBVxDu6q9UYtWXWVlIyLQVDbyuic3RQNaAD2LRjA7P1Hr/fSG4+BX1E90d\n hmCNllr9ZxmZOs1xTedWd9iQF4dV4F9SFuO5oVX80dssv4t9cj59KDhIcgN0d3WD\n 7Nyuh03dRJ4Nq7c22InlSs2pk5FUJsjBtlhZiQWyeUKAkZBh0eWZ5Cf+I4WReNRs\n k01u9XXMDm9yE4vRg7Eh7w+Y31E2cuT1zf/dR+PEna1VY+ihM4g+IexZzx6YM6bC\n ibdcHoXPNxFkfPSBHmP3QutrDc9LNbDINQTYaKinrHQklIYxFERsqhlGhexnvtG2\n iQIDAQAB\n -----END PUBLIC KEY-----\"\"\"\n\n mp_client = DelegatedAuthClient(pubkey, \"https://auth.my-profile.eu/auth/index.php\",\n # 5 min. Default is 60s\n token_expiration=300)\n\n # Callback URL where you will receive the auth URL\n # Replace it\n cb_url = \"https://localhost/login/cb\"\n\n # URL to which you should redirect your user\n request_url = mp_client.gen_request_url(cb_url)\n print request_url\n\nWill display::\n\n https://auth.my-profile.eu/auth/index.php?authreqissuer=https%3A%2F%2Flocalhost%2Flogin%2Fcb\n\nClick on `this link `_\nand authenticate yourself with your WebID-TLS cert.\nIf you don't have a cert, you create one quickly on https://my-profile.eu/profile .\n\nYou will then be redirect to an URL. Copy it and run the following instructions::\n\n # Redirected URL from auth.my-profile.eu\n # Change it\n auth_url = \"https://localhost/login/cb?webid=https%3A%2F%2Fmy-profile.eu%2Fpeople%2Fbcogrel-testonly%2Fcard%23me&ts=2014-03-23CET13%3A55%3A53%2B01%3A00&sig=gEBEawmo69Tb6vklQIPic1IzUePNZ0rSENCXYtVry55khAKD27DDWI7XNXtle6pLhjo4_BUaPTKLCre640Y5wnat1zTva71N70d7XttfzCQCbzKjp_kdruuY97WslmmFV6hm_0KliuaEHg1m1NAMjawntWwOEC3oAuKhXhIQPgiV4nQNG7x2h53yrP4oJL-q-ltgSI9Fn83mY3Vn6ENu0IN1KC3_aDJ2uERyJEiamX-WbB8OSLxdjN4cmg-Kv1WdSpBTQOmF2MHjvBd7mGwWtJ_Ogr36O1TtyAaEE_z2TUlOeQNE0sW7WRYNma47kUz630nBh3X0nwPTGJkAXpSbMg&referer=https://auth.my-profile.eu\"\n\n try:\n webid = mp_client.check(auth_url)\n\n print \"Your webID: %s\" % webid\n\n except ExpiredAuthURLError as e:\n # Expired authentication URL (if you used mine)\n print \"Error: %s \" % e\n except UserAuthException as e:\n print \"Impossible to authenticate the user. Reason: %s\" % e.__class__.__name__\n\n except AuthServiceError as e:\n # Problem with auth.my-profile.eu\n print \"Problem with the auth service: %s \" % e.__class__.__name__\n\nIf you have not changed the auth url, you will see that the following message::\n\n Error: Auth URL has expired XXXX seconds ago\n\n\nIf you take a very long token expiration duration, you will able to see the WebID I used.\n\n\nSigning Auth URLs\n~~~~~~~~~~~~~~~~~\n\nIf you can use the URLSigningService to build a WebID authentication service\n(with or without WebID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aPi8no3SKuUUXCH0OzaD4ytK4JB/vZFi6vYLDmVbcg/jZmRh\n vH7TbJQQrYcTyzMXMp4vmRDVzOZlO1OiXXUyph0CgYAjJTb2JqzyWMQfBRPAmKX/\n 2sAqgEAEXTB3VDy4buHQhZYaTvR8wQ1BQH+rK8VmJQDbi+yBDRLzl3htXu8F7f1g\n Q66WwPe5K4z75RrYnwKz/2RFokVJsq2HSo0PVe6knlsY1SLngGfZxLjHQKRtEWtp\n 9UPnHzsE8QkV+1fc0YGs+wKBgQCC6ALawHn48VQu4iOYWA4Ehw4VGQ9S+BnAVpwY\n jIz/LMn232pj2T9rsGQkicE+c28d50otpNYQXk4mvV1WpULL1DhOkK99FJAugvl1\n N7uvOjG4I/xtW+5+rDRTv3M6Hwq1rF01eroAbcQP4+Wz79zcnGp20UNNpFD9jVXy\n yCMCWQKBgEuVABKo/679QwiXG+L0x5cIQtIoHTpsNAfdNYBkAXkNsxjbGkBOrKVE\n qaMI6vGqovsL9NpdteFEKxMGd831vF9/uZJzoMOPW69YgX0NXm7k9FltBkUqI8T5\n tyNleVwT49UmLF7cMTZS0nPro9u+ktHqwP30H44MZmpj0Q5rPkiC\n -----END RSA PRIVATE KEY-----\"\"\"\n\n # Your auth service root URL\n # Change it\n referer_url = \"https://example.org\"\n signing_service = URLSigningService(private_key, referer_url)\n\n\n # Tested WebID\n webid = \"https://my-profile.eu/people/bcogrel-testonly/card#me\"\n requester_url = \"https://localhost/login/cb\"\n\n auth_url = signing_service.gen_auth_url(webid, requester_url)\n print \"Auth URL: %s\" % auth_url\n\n # Error: no claim provided by the user\n error_url = signing_service.gen_no_claim_error_url(requester_url)\n print \"No claim error URL: %s\" % error_url\n\n\nHave fun!", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/bcogrel/webid-delegated-auth", "keywords": null, "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "webid-delegated-auth", "package_url": "https://pypi.org/project/webid-delegated-auth/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/webid-delegated-auth/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/bcogrel/webid-delegated-auth" }, "release_url": "https://pypi.org/project/webid-delegated-auth/0.1/", "requires_dist": null, "requires_python": null, "summary": "WebID delegated authentication tools (signing and checking auth URLs)", "version": "0.1" }, "last_serial": 1038485, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "cf8900ebb9da90d6af3ba0a5deada7cc", "sha256": "aba490fc28f5d2fbd0bc4780ec6a8cba606dc7db9f0fc1e96242765c9e654918" }, "downloads": -1, "filename": "webid-delegated-auth-0.1.tar.gz", "has_sig": false, "md5_digest": "cf8900ebb9da90d6af3ba0a5deada7cc", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8599, "upload_time": "2014-03-23T14:54:01", "url": "https://files.pythonhosted.org/packages/b3/c2/8dfdab35c790d187fc8ac3e4d0698335dd1a5d82604716960d3a54c68030/webid-delegated-auth-0.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "cf8900ebb9da90d6af3ba0a5deada7cc", "sha256": "aba490fc28f5d2fbd0bc4780ec6a8cba606dc7db9f0fc1e96242765c9e654918" }, "downloads": -1, "filename": "webid-delegated-auth-0.1.tar.gz", "has_sig": false, "md5_digest": "cf8900ebb9da90d6af3ba0a5deada7cc", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8599, "upload_time": "2014-03-23T14:54:01", "url": "https://files.pythonhosted.org/packages/b3/c2/8dfdab35c790d187fc8ac3e4d0698335dd1a5d82604716960d3a54c68030/webid-delegated-auth-0.1.tar.gz" } ] }