{"id":35316838,"url":"https://github.com/authlete/authlete-go-gin","last_synced_at":"2026-04-08T12:33:17.915Z","repository":{"id":57547581,"uuid":"209266502","full_name":"authlete/authlete-go-gin","owner":"authlete","description":"Authlete Library for Gin (Go)","archived":false,"fork":false,"pushed_at":"2023-01-22T08:09:08.000Z","size":64,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":8,"default_branch":"master","last_synced_at":"2024-09-21T00:28:54.373Z","etag":null,"topics":["gin","go","golang","library","oauth","oauth2","oidc","openid-connect"],"latest_commit_sha":null,"homepage":"https://www.authlete.com/","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/authlete.png","metadata":{"files":{"readme":"README.ja.md","changelog":"CHANGES.ja.md","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":"2019-09-18T09:10:33.000Z","updated_at":"2024-07-01T11:20:53.000Z","dependencies_parsed_at":"2023-02-12T15:02:08.109Z","dependency_job_id":null,"html_url":"https://github.com/authlete/authlete-go-gin","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/authlete/authlete-go-gin","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/authlete%2Fauthlete-go-gin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/authlete%2Fauthlete-go-gin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/authlete%2Fauthlete-go-gin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/authlete%2Fauthlete-go-gin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/authlete","download_url":"https://codeload.github.com/authlete/authlete-go-gin/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/authlete%2Fauthlete-go-gin/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31556232,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-08T10:21:54.569Z","status":"ssl_error","status_checked_at":"2026-04-08T10:21:38.171Z","response_time":54,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["gin","go","golang","library","oauth","oauth2","oidc","openid-connect"],"created_at":"2025-12-30T18:39:10.433Z","updated_at":"2026-04-08T12:33:17.874Z","avatar_url":"https://github.com/authlete.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"Gin (Go) 用 Authlete ライブラリ\n===============================\n\n概要\n----\n\nこのライブラリは、[OAuth 2.0][RFC6749] および [OpenID Connect][OIDC]\nをサポートする認可サーバーと、\nリソースサーバーを実装するためのユーティリティー部品群を提供します。\n\nこのライブラリは、Gin API と authlete-go ライブラリを用いて書かれています。\n[Gin][Gin] は Go で書かれた Web フレームワークの一つです。\n一方、[authlete-go][AuthleteGo] は Authlete\nが提供するもう一つのオープンソースライブラリで、[Authlete Web API][AuthleteAPI]\nとやりとりするための基本部品群を含んでいます。\n\n[Authlete][Authlete] は OAuth 2.0 と OpenID Connect の実装を提供するクラウドサービスです\n([overview][AuthleteOverview])。 認可データ (アクセストークン等)\nや認可サーバー自体の設定、クライアントアプリケーション群の設定はクラウド上の Authlete\nサーバーに保存されるため、Authlete を使うことで「DB レス」の認可サーバーを構築することができます。\n\n[gin-oauth-server][GinOAuthServer] はこのライブラリを使用している認可サーバーの実装で、\n認可エンドポイントやトークンエンドポイントに加え、JWK Set エンドポイント、\nディスカバリーエンドポイント、取り消しエンドポイントの実装を含んでいます。\nまた、[gin-resource-server][GinResourceServer]\nはこのライブラリを使用しているリソースサーバーの実装です。 [OpenID Connect Core 1.0][OIDCCore]\nで定義されている[ユーザー情報エンドポイント][UserInfoEndpoint]\nをサポートし、また、保護リソースエンドポイントの例を含んでいます。\nあなたの認可サーバーおよびリソースサーバーの実装の開始点として、\nこれらのサンプル実装を活用してください。\n\nライセンス\n----------\n\n  Apache License, Version 2.0\n\nソースコード\n------------\n\n  \u003ccode\u003ehttps://github.com/authlete/authlete-go-gin\u003c/code\u003e\n\nパッケージ\n----------\n\n    import (\n        \"github.com/authlete/authlete-go-gin/endpoint\"\n        \"github.com/authlete/authlete-go-gin/handler\"\n        \"github.com/authlete/authlete-go-gin/handler/spi\"\n        \"github.com/authlete/authlete-go-gin/middleware\"\n        \"github.com/authlete/authlete-go-gin/web\"\n    )\n\nサンプル\n--------\n\n#### ディスカバリー・エンドポイント\n\n```go\npackage main\n\nimport (\n    \"github.com/authlete/authlete-go-gin/endpoint\"\n    \"github.com/authlete/authlete-go-gin/middleware\"\n    \"github.com/gin-gonic/gin\"\n)\n\nfunc main() {\n    r := gin.Default()\n\n    // `authlete.toml` から設定をロードし、api.AuthleteApi のインスタンスを\n    // 生成し、`AuthleteApi` というキーでそのインスタンスを Gin コンテキストに\n    // 設定するミドルウェアを登録する。\n    r.Use(middleware.AuthleteApi_Toml(`authlete.toml`))\n\n    // OpenID Connect Discovery 1.0 に準拠するディスカバリー・エンドポイントを\n    // 定義する。\n    r.GET(\"/.well-known/openid-configuration\",\n          endpoint.DiscoveryEndpoint_Handler())\n\n    // http://localhost:8080 でこのサーバーを起動する。\n    r.Run()\n}\n```\n\n#### 保護リソースエンドポイント\n\n```go\npackage main\n\nimport (\n    \"github.com/authlete/authlete-go-gin/endpoint\"\n    \"github.com/authlete/authlete-go-gin/middleware\"\n    \"github.com/gin-gonic/gin\"\n)\n\ntype HelloEndpoint struct {\n    endpoint.BaseEndpoint\n}\n\nfunc (self *HelloEndpoint) Handle(ctx *gin.Context) {\n    // リクエストに含まれているアクセストークンを検証する。\n    valid, validator := self.ValidateAccessToken(ctx, nil)\n\n    // アクセストークンが無効の場合\n    if !valid {\n        // RFC 6750 に準拠するエラー応答を生成する。\n        validator.Deny(ctx)\n        return\n    }\n\n    // このエンドポイントからの応答\n    ctx.JSON(200, gin.H{\"message\":\"hello\"})\n}\n\nfunc HelloEndpoint_Handler() gin.HandlerFunc {\n    // Hello エンドポイントのインスタンス\n    endpoint := HelloEndpoint{}\n\n    return func(ctx *gin.Context) {\n        endpoint.Handle(ctx)\n    }\n}\n\nfunc main() {\n    r := gin.Default()\n\n    // 環境から設定を読み込み、api.AuthleteApi のインスタンスを生成し、\n    // `AuthleteApi` というキーでそのインスタンスを Gin コンテキストに\n    // 設定するミドルウェアを登録する。\n    r.Use(middleware.AuthleteApi_Env())\n\n    // '/api/hello' API を定義する。\n    r.GET(\"/api/hello\", HelloEndpoint_Handler())\n\n    // http://localhost:8080 でこのサーバーを起動する。\n    r.Run()\n}\n```\n\nコンタクト\n----------\n\nコンタクトフォーム : https://www.authlete.com/contact/\n\n| 目的 | メールアドレス       |\n|:-----|:---------------------|\n| 一般 | info@authlete.com    |\n| 営業 | sales@authlete.com   |\n| 広報 | pr@authlete.com      |\n| 技術 | support@authlete.com |\n\n[Authlete]:          https://www.authlete.com/ja/\n[AuthleteAPI]:       https://docs.authlete.com/\n[AuthleteOverview]:  https://www.authlete.com/ja/developers/overview/\n[AuthleteGo]:        https://github.com/authlete/authlete-go/\n[Gin]:               https://github.com/gin-gonic/gin\n[GinOAuthServer]:    https://github.com/authlete/gin-oauth-server/\n[GinResourceServer]: https://github.com/authlete/gin-resource-server/\n[OIDC]:              https://openid.net/connect/\n[OIDCCore]:          https://openid.net/specs/openid-connect-core-1_0.html\n[RFC6749]:           https://tools.ietf.org/html/rfc6749\n[UserInfoEndpoint]:  https://openid.net/specs/openid-connect-core-1_0.html#UserInfo\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fauthlete%2Fauthlete-go-gin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fauthlete%2Fauthlete-go-gin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fauthlete%2Fauthlete-go-gin/lists"}