{"id":16950993,"url":"https://github.com/rajatjindal/oauth-login-spin","last_synced_at":"2025-03-21T10:42:50.650Z","repository":{"id":193331591,"uuid":"688589341","full_name":"rajatjindal/oauth-login-spin","owner":"rajatjindal","description":"spin component to add \"login with oauth\" functionality to your app","archived":false,"fork":false,"pushed_at":"2023-12-03T17:26:12.000Z","size":598,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-26T07:12:15.909Z","etag":null,"topics":["golang","oauth2","spin","wasi","webassembly"],"latest_commit_sha":null,"homepage":"","language":"Go","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/rajatjindal.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":"2023-09-07T17:01:00.000Z","updated_at":"2023-09-13T06:54:51.000Z","dependencies_parsed_at":null,"dependency_job_id":"cafa4a9d-cb0b-4e93-a7d2-7780071e9b12","html_url":"https://github.com/rajatjindal/oauth-login-spin","commit_stats":null,"previous_names":["rajatjindal/oauth-login-spin"],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rajatjindal%2Foauth-login-spin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rajatjindal%2Foauth-login-spin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rajatjindal%2Foauth-login-spin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rajatjindal%2Foauth-login-spin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rajatjindal","download_url":"https://codeload.github.com/rajatjindal/oauth-login-spin/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244781017,"owners_count":20509503,"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":["golang","oauth2","spin","wasi","webassembly"],"created_at":"2024-10-13T21:59:04.290Z","updated_at":"2025-03-21T10:42:50.630Z","avatar_url":"https://github.com/rajatjindal.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Spin oauth login\n\nThis is a simple Spin component for adding oauth login functionality to your Spin app\n\n## Using the oauth login template\n\nFirst, configure the template:\n\n```bash\n$ spin templates install --git https://github.com/rajatjindal/oauth-login-spin --update\nCopying remote template source\nInstalling template oauth-login...\nInstalled 1 template(s)\n\n+-------------------------------------------+\n| Name          Description                 |\n+===========================================+\n| oauth-login   Add oauth login to your app |\n+-------------------------------------------+\n```\n\nThen, add this component to your existing app:\n\n```bash\n$ spin add oauth-login\n```\n\nThis will create the following component in your `spin.toml`:\n\n```toml\n[variables]\nauth_provider = { default = \"github\" }\nscopes = { default = \"openid,profile,email\" }\nclient_id = { required = true, secret = true }\nclient_secret = { required = true, secret = true }\n\n[[component]]\nid = \"oauth-login\"\nsource = { url = \"https://github.com/rajatjindal/oauth-login-spin/releases/download/v0.0.8/login.wasm\", digest = \"sha256:d7697dcf34989c444c164a1428cc6ab8ba02a4c113d3d344492ca54b9e4ef27d\" }\nallowed_http_hosts = [\"https://github.com\"]\nkey_value_stores = [\"default\"]\n[component.trigger]\nroute = \"/internal/login/...\"\n[component.config]\nauth_provider = \"{{ auth_provider }}\"\nscopes = \"{{ scopes }}\"\nclient_id = \"{{ client_id }}\"\nclient_secret = \"{{ client_secret }}\"\n```\n\nYou can now provide client_id and client_secret for your oauth app using `--variable client_id=\u003cclient_id\u003e --variable client_secret=\u003cclient_secret\u003e` during deploy or you can use GitHub action as follows:\n\n```yaml\n  - name: Deploy\n    uses: fermyon/actions/spin/deploy@v1\n    with:\n      fermyon_token: ${{ secrets.FERMYON_CLOUD_TOKEN }}\n      variables: |-\n        client_id=${{ secrets.OAUTH_CLIENT_ID }}\n        client_secret=${{ secrets.OAUTH_CLIENT_SECRET }}\n```\n\nonce added to your app, you just need to navigate user to `/internal/login/start` path to get oauth process started. once the auth is successful, the component will redirect your app to `/auth/success` (configurable via config `success_url`)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frajatjindal%2Foauth-login-spin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frajatjindal%2Foauth-login-spin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frajatjindal%2Foauth-login-spin/lists"}