{"id":32551191,"url":"https://github.com/aziontech/azion_secure_token","last_synced_at":"2026-07-12T00:31:42.348Z","repository":{"id":114483706,"uuid":"64665348","full_name":"aziontech/azion_secure_token","owner":"aziontech","description":"Use the Secure Token feature in Azion.","archived":false,"fork":false,"pushed_at":"2024-04-10T17:25:54.000Z","size":20,"stargazers_count":1,"open_issues_count":1,"forks_count":2,"subscribers_count":26,"default_branch":"master","last_synced_at":"2025-10-24T13:58:05.848Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://www.azion.com","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aziontech.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2016-08-01T12:34:53.000Z","updated_at":"2025-03-17T19:57:37.000Z","dependencies_parsed_at":"2023-05-16T22:45:08.792Z","dependency_job_id":null,"html_url":"https://github.com/aziontech/azion_secure_token","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/aziontech/azion_secure_token","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aziontech%2Fazion_secure_token","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aziontech%2Fazion_secure_token/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aziontech%2Fazion_secure_token/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aziontech%2Fazion_secure_token/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aziontech","download_url":"https://codeload.github.com/aziontech/azion_secure_token/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aziontech%2Fazion_secure_token/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35378722,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-11T02:00:05.354Z","response_time":104,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-10-28T20:58:56.025Z","updated_at":"2026-07-12T00:31:42.335Z","avatar_url":"https://github.com/aziontech.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Azion Secure Token Authentication\n\nAzion **Secure Token** allows you to create token-based, time-limited URLs. This way, you can give a particular user access to a link for a specific amount of time.\n\nThe creation and validation of signatures for cookies, authentication headers, and other security measures can be done using these tokens, which can be altered in a variety of ways. Utilizing both HLS and Progressive Download, the solution is frequently used to secure video assets, including those used for live streaming and on-demand content.\n\n\u003e Read more on the [How to install the Secure Token integration](https://www.azion.com/en/documentation/products/guides/secure-token/) guide.\n\n---\n\n## Generating the token\n\nIn this repository, you’ll find two example scripts to generate the tokens, a Python and a PHP script. You can run them locally and generate the token or you can generate these tokens on your own platform with your own code.\n\nUsing the Python script as an example, you’ll have the following source code:\n\n```\n#!/usr/bin/env python\n\nimport base64\nimport hashlib\n\nsecret = 'mysecret'\nuri = '/my/uri'\nexpire = '1470055000'\n\nmd5 = hashlib.md5()\nmd5.update(secret + uri + expire)\ntoken = base64.b64encode(md5.digest()).replace('=','').replace('+','-').replace('/','_')\n\nprint 'http://www.example.org%s?st=%s\u0026e=%s' % (uri, token, expire)\n```\n\nWhere:\n\n- `secret`: a string of your choice that will be used to generate the token.\n- `uri`: the URI to use with the token.\n- `expire`: the expiration time of the token.\n\nSave the generated token, regardless of the way you generated it.\n\nIn this case, the edge function expects to find a token in the `st= GET` parameter and an expiration time in the`e=` parameter. Tokens are query strings in the format `?st=XXX\u0026e=YYY. For example: `?st=m6WCATfRgS_5lcyChCPgrw\u0026e=1470055000`.\n\nThe full request URL would look like this:\n\n`http://www.example.org/my/uri?st=m6WCATfRgS_5lcyChCPgrw\u0026e=1470055000`\n\n---\n\n## Adding the token via Real-Time Manager\n\nTo start using **Secure Token**, you need to get and instantiate the integration's function as explained in the [how-to guide](https://www.azion.com/en/documentation/products/guides/secure-token/). While [setting up the integration](https://www.azion.com/en/documentation/products/guides/secure-token/#setting-up-the-integration), you'll need to add the token in the **Args** tab: \n\n```\n{\n    \"secure_token_secret\": \"thatisthesecret\"\n}\n```\n\n​​Where `secure_token_secret` will be the secret string you’ve passed on the code when generating the token in the previous step.\n\n---\n\n## Azion's platform validation\n\nAzion's platform will check for two conditions:\n\nIs the current time greater than the expiration time specified in the token?\nDoes Azion's signature match the signature of the token?\n\nIf the signature is invalid, the system will return a `403` error. If the signature is valid but the expiration time has elapsed, the system will return a `410` error. The different response codes help to debug (and are also \"more correct\"). A malicious user can't modify the expiration time of their token (if they did, the signature would no longer match).\n\n---\n\n## Client Side Scripts\n\nThe client or web application must be able to generate tokens to authenticate with Azion's platform.\n\nYou can find pseudo-code examples here on GitHub. Feel free to modify them and, in case you write your own codes, share them with Azion's team.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faziontech%2Fazion_secure_token","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faziontech%2Fazion_secure_token","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faziontech%2Fazion_secure_token/lists"}