{"id":27372164,"url":"https://github.com/apprentice3d/aws-lambda-token-fetcher","last_synced_at":"2025-06-15T10:34:07.075Z","repository":{"id":57578996,"uuid":"143181576","full_name":"apprentice3d/aws-lambda-token-fetcher","owner":"apprentice3d","description":"Golang AWS Lambda function used to get viewable:read 2-legged tokens.","archived":false,"fork":false,"pushed_at":"2018-08-02T12:53:07.000Z","size":178,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-13T10:02:19.657Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Shell","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/apprentice3d.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-08-01T16:28:34.000Z","updated_at":"2018-09-10T21:19:29.000Z","dependencies_parsed_at":"2022-09-15T19:32:06.915Z","dependency_job_id":null,"html_url":"https://github.com/apprentice3d/aws-lambda-token-fetcher","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/apprentice3d/aws-lambda-token-fetcher","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apprentice3d%2Faws-lambda-token-fetcher","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apprentice3d%2Faws-lambda-token-fetcher/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apprentice3d%2Faws-lambda-token-fetcher/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apprentice3d%2Faws-lambda-token-fetcher/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/apprentice3d","download_url":"https://codeload.github.com/apprentice3d/aws-lambda-token-fetcher/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apprentice3d%2Faws-lambda-token-fetcher/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259960482,"owners_count":22938073,"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","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-04-13T09:53:13.422Z","updated_at":"2025-06-15T10:34:07.055Z","avatar_url":"https://github.com/apprentice3d.png","language":"Shell","readme":"## AWS Lambda token fetcher\n\nSmall lambda written in Golang and used to get `viewables:read` 2-legged tokens, which in conjunction with AWS API Gateway creates the minimal backend needed for serving to Forge Viewer the access tokens.\n\n### Setup\n1. create a deployment package following the [AWS guide](https://docs.aws.amazon.com/lambda/latest/dg/lambda-go-how-to-create-deployment-package.html) or create a new lambda through AWS portal and upload the zip file (either prepared by you or downloaded from [releases](https://github.com/apprentice3d/aws-lambda-token-fetcher/releases))(A).\n2.  Set the environment variables with your Autodesk Forge credentials (as shown in bellow at B). \n\n![](./doc/lambda.jpg)    \u003cbr/\u003e   \n3. Through AWS portal, in API Gateway, create a new API, set the integration type as lambda and specify the AWS lambda created at step 1.\n\n![](./doc/gateway.jpg) \u003c/br\u003e\n4. Use the endpoint created by the API Gateway, in your apps to get the `viewables:read` tokens, used by viewer to display your models:\n\n```javascript\n    let options = {\n        env: 'AutodeskProduction',\n        getAccessToken: (onGetAccessToken) =\u003e {\n            fetch('https://9irt90dm6j.execute-api.us-east-1.amazonaws.com/prod')\n                .then(response =\u003e response.json())\n                .then(data =\u003e {\n                    let accessToken = data[\"access_token\"];\n                    let expireTimeSeconds = data[\"expires_in\"];\n                    onGetAccessToken(accessToken, expireTimeSeconds);\n                })\n        }\n    };\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapprentice3d%2Faws-lambda-token-fetcher","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fapprentice3d%2Faws-lambda-token-fetcher","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapprentice3d%2Faws-lambda-token-fetcher/lists"}