{"id":13490876,"url":"https://github.com/coreos/go-oidc","last_synced_at":"2025-05-13T15:05:36.566Z","repository":{"id":37432559,"uuid":"38275789","full_name":"coreos/go-oidc","owner":"coreos","description":"A Go OpenID Connect client.","archived":false,"fork":false,"pushed_at":"2025-04-03T21:25:19.000Z","size":325,"stargazers_count":2114,"open_issues_count":38,"forks_count":414,"subscribers_count":38,"default_branch":"v3","last_synced_at":"2025-04-30T21:03:03.501Z","etag":null,"topics":["golang"],"latest_commit_sha":null,"homepage":"","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/coreos.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"code-of-conduct.md","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,"zenodo":null}},"created_at":"2015-06-29T23:06:33.000Z","updated_at":"2025-04-30T07:10:57.000Z","dependencies_parsed_at":"2023-11-28T08:26:20.635Z","dependency_job_id":"88cadbe9-d770-45dd-9cd5-3dc7db503be2","html_url":"https://github.com/coreos/go-oidc","commit_stats":{"total_commits":162,"total_committers":48,"mean_commits":3.375,"dds":0.6234567901234568,"last_synced_commit":"0fe98873951208147e6d412602432038c91cda54"},"previous_names":[],"tags_count":22,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coreos%2Fgo-oidc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coreos%2Fgo-oidc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coreos%2Fgo-oidc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coreos%2Fgo-oidc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/coreos","download_url":"https://codeload.github.com/coreos/go-oidc/tar.gz/refs/heads/v3","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252552290,"owners_count":21766675,"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"],"created_at":"2024-07-31T19:00:51.720Z","updated_at":"2025-05-05T18:27:26.011Z","avatar_url":"https://github.com/coreos.png","language":"Go","funding_links":[],"categories":["Go","Relying Parties (RP) Libraries","Client Library"],"sub_categories":["Golang","Go"],"readme":"# go-oidc\n\n[![Go Reference](https://pkg.go.dev/badge/github.com/coreos/go-oidc/v3/oidc.svg)](https://pkg.go.dev/github.com/coreos/go-oidc/v3/oidc)\n![github.com/coreos/go-oidc/v3](https://github.com/coreos/go-oidc/workflows/test/badge.svg?branch=v3)\n\n## Updates from v2 to v3\n\nThere were two breaking changes made to the v3 branch. The import path has changed from:\n\n```\ngithub.com/coreos/go-oidc\n```\n\nto:\n\n```\ngithub.com/coreos/go-oidc/v3/oidc\n```\n\nAnd the return type of `NewRemoteKeySet()` is now `*RemoteKeySet` instead of an interface ([#262](https://github.com/coreos/go-oidc/pull/262)).\n\n## OpenID Connect support for Go\n\nThis package enables OpenID Connect support for the [golang.org/x/oauth2](https://godoc.org/golang.org/x/oauth2) package.\n\n```go\nprovider, err := oidc.NewProvider(ctx, \"https://accounts.google.com\")\nif err != nil {\n    // handle error\n}\n\n// Configure an OpenID Connect aware OAuth2 client.\noauth2Config := oauth2.Config{\n    ClientID:     clientID,\n    ClientSecret: clientSecret,\n    RedirectURL:  redirectURL,\n\n    // Discovery returns the OAuth2 endpoints.\n    Endpoint: provider.Endpoint(),\n\n    // \"openid\" is a required scope for OpenID Connect flows.\n    Scopes: []string{oidc.ScopeOpenID, \"profile\", \"email\"},\n}\n```\n\nOAuth2 redirects are unchanged.\n\n```go\nfunc handleRedirect(w http.ResponseWriter, r *http.Request) {\n    http.Redirect(w, r, oauth2Config.AuthCodeURL(state), http.StatusFound)\n}\n```\n\nThe on responses, the provider can be used to verify ID Tokens.\n\n```go\nvar verifier = provider.Verifier(\u0026oidc.Config{ClientID: clientID})\n\nfunc handleOAuth2Callback(w http.ResponseWriter, r *http.Request) {\n    // Verify state and errors.\n\n    oauth2Token, err := oauth2Config.Exchange(ctx, r.URL.Query().Get(\"code\"))\n    if err != nil {\n        // handle error\n    }\n\n    // Extract the ID Token from OAuth2 token.\n    rawIDToken, ok := oauth2Token.Extra(\"id_token\").(string)\n    if !ok {\n        // handle missing token\n    }\n\n    // Parse and verify ID Token payload.\n    idToken, err := verifier.Verify(ctx, rawIDToken)\n    if err != nil {\n        // handle error\n    }\n\n    // Extract custom claims\n    var claims struct {\n        Email    string `json:\"email\"`\n        Verified bool   `json:\"email_verified\"`\n    }\n    if err := idToken.Claims(\u0026claims); err != nil {\n        // handle error\n    }\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoreos%2Fgo-oidc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcoreos%2Fgo-oidc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoreos%2Fgo-oidc/lists"}