{"id":23380639,"url":"https://github.com/agility/generate-agilitycms-ugc-auth-node","last_synced_at":"2025-09-10T12:41:05.989Z","repository":{"id":97728620,"uuid":"271808376","full_name":"agility/generate-agilitycms-ugc-auth-node","owner":"agility","description":"Generates authentication parameters for Agility UGC","archived":false,"fork":false,"pushed_at":"2020-06-12T13:51:38.000Z","size":4,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-08T07:43:21.082Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/agility.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-06-12T13:45:27.000Z","updated_at":"2020-06-12T13:51:40.000Z","dependencies_parsed_at":null,"dependency_job_id":"6925a08a-a58c-42ec-8783-7dee8e5e0d75","html_url":"https://github.com/agility/generate-agilitycms-ugc-auth-node","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/agility/generate-agilitycms-ugc-auth-node","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agility%2Fgenerate-agilitycms-ugc-auth-node","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agility%2Fgenerate-agilitycms-ugc-auth-node/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agility%2Fgenerate-agilitycms-ugc-auth-node/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agility%2Fgenerate-agilitycms-ugc-auth-node/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/agility","download_url":"https://codeload.github.com/agility/generate-agilitycms-ugc-auth-node/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agility%2Fgenerate-agilitycms-ugc-auth-node/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274463671,"owners_count":25290115,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-10T02:00:12.551Z","response_time":83,"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":"2024-12-21T20:17:22.961Z","updated_at":"2025-09-10T12:41:05.932Z","avatar_url":"https://github.com/agility.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# generate-agilitycms-ugc-auth-node\nGenerates authentication parameters for Agility UGC\n\n## Example\n```\nconst sha1 = require('sha1');\n\nconst UGCCREDENTIALS = {\n    key: \"XXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXXX\", //your UGC Public Key\n    pass: \"XXXXXX-XXXX-XXXXX-XXXXX-XXXXXXXXXXX\" //your UGC Password \n}\nconst generateUGSettings = (UGCCREDENTIALS) =\u003e {\n    // SHA 1 of Seconds.ProfileID.SecretKey.AccessKey.Random\n    const jan12001 = new Date(\"Jan 1 2001\");\n    const now = new Date();\n    const msecondsSinceJan12001 = now.getTime() - jan12001.getTime();\n    const secondsSinceJan12001 = Math.round(msecondsSinceJan12001 / 1000);\n    const random = Math.floor((Math.random() * 1000));\n    return {\n        'Url': 'https://ugc-ca.agilitycms.com/Agility-UGC-API-JSONP.svc',\n        'AccessKey': UGCCREDENTIALS.key, //the website API Access Key provided to you\n        'Seconds': secondsSinceJan12001, //is the number of seconds that have elapsed since Jan 1/2001.\n        'RandomNumber': random, //just a random number between 1-1000\n        'ProfileRecordID': '-1', //the profile record ID of the logged-in website user, -1 is anonymous\n        'AccessHash': sha1(`${secondsSinceJan12001}.-1.${UGCCREDENTIALS.pass}.${UGCCREDENTIALS.key}.${random}`)  //The SHA hash of all the above variables (Seconds.ProfileID.SecretKey.AccessKey.Random)\n    };\n}\n\nconsole.log(generateUGSettings(UGCCREDENTIALS));\n```\n\n## How to Generate Credentials\nEnter your `key` and `pass`. Then run the script.\n```\n\u003e node index.js\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fagility%2Fgenerate-agilitycms-ugc-auth-node","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fagility%2Fgenerate-agilitycms-ugc-auth-node","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fagility%2Fgenerate-agilitycms-ugc-auth-node/lists"}