{"id":24929801,"url":"https://github.com/traptitech/go-traq-oauth2","last_synced_at":"2025-03-28T13:28:57.272Z","repository":{"id":209749059,"uuid":"724858189","full_name":"traPtitech/go-traq-oauth2","owner":"traPtitech","description":"Package traqoauth2 provides constants for using OAuth2 to access traQ.","archived":false,"fork":false,"pushed_at":"2025-03-01T03:28:25.000Z","size":44,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-01T04:23:24.266Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","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/traPtitech.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-11-28T23:47:24.000Z","updated_at":"2025-03-01T03:28:23.000Z","dependencies_parsed_at":null,"dependency_job_id":"a8fa674b-8e70-4618-aac2-7bf70ec8f30e","html_url":"https://github.com/traPtitech/go-traq-oauth2","commit_stats":null,"previous_names":["traptitech/go-traq-oauth2"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/traPtitech%2Fgo-traq-oauth2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/traPtitech%2Fgo-traq-oauth2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/traPtitech%2Fgo-traq-oauth2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/traPtitech%2Fgo-traq-oauth2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/traPtitech","download_url":"https://codeload.github.com/traPtitech/go-traq-oauth2/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246036827,"owners_count":20713300,"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-02-02T13:51:54.512Z","updated_at":"2025-03-28T13:28:57.245Z","avatar_url":"https://github.com/traPtitech.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# go-traq-oauth2\n\n[![GoDoc](https://godoc.org/github.com/traPtitech/go-traq-oauth2?status.svg)](https://godoc.org/github.com/traPtitech/go-traq-oauth2)\n\nPackage traqoauth2 provides constants for using OAuth2 to access traQ.\n\n## Usage\n\n\u003e [!WARNING]\n\u003e OAuth2 Authorization Code Flowに則ったClientを実装する前に、他のより簡単な方法で実装できないか検討してください。\n\u003e - ログインユーザーの traQ ID (e.g. `@traP`) を取得したい場合\n\u003e   - [traPtitech/NeoShowcase](https://github.com/traPtitech/NeoShowcase)\n\u003e   - [traPtitech/caddy-trap-auth](https://github.com/traPtitech/caddy-trap-auth)\n\u003e   - [traPtitech/traefik-forward-auth](https://github.com/traPtitech/traefik-forward-auth)\n\u003e - ログインユーザーの識別情報を必要としないデータを取得したい場合 (e.g. GET /users, GET /groups/:groupID)\n\u003e   - [Bot](https://bot-console.trap.jp/docs/bot)のAccess Tokenを用いる\n\u003e   - (実装予定) [OAuth2 Client Credential Flow](https://github.com/traPtitech/traQ/issues/2403) を用いる\n\u003e - ログインユーザーの識別情報を利用したい場合 (e.g. GET /users/me, POST /channels/:channelID/messages)\n\u003e   - OAuth2 Authorization Code Flow\n\nFull example: [_example/](_example/)\n\n```go\npackage main\n\nimport (\n  // ...\n  traqoauth2 \"github.com/traPtitech/go-traq-oauth2\"\n)\n\n// Configure at https://bot-console.trap.jp/clients\nvar  oauth2Config = oauth2.Config{\n  ClientID:     os.Getenv(\"TRAQ_CLIENT_ID\"),\n  ClientSecret: os.Getenv(\"TRAQ_CLIENT_SECRET\"),\n  Endpoint:     traqoauth2.Prod, // or traqoauth2.Staging\n  RedirectURL:  os.Getenv(\"TRAQ_REDIRECT_URL\"),\n  Scopes:       []string{traqoauth2.ScopeRead, traqoauth2.ScopeWrite}\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftraptitech%2Fgo-traq-oauth2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftraptitech%2Fgo-traq-oauth2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftraptitech%2Fgo-traq-oauth2/lists"}