{"id":15686355,"url":"https://github.com/pbrisbin/google-oauth2","last_synced_at":"2025-05-07T17:07:01.238Z","repository":{"id":23254275,"uuid":"26612378","full_name":"pbrisbin/google-oauth2","owner":"pbrisbin","description":"Google OAuth2 token negotiation","archived":false,"fork":false,"pushed_at":"2021-03-17T12:56:24.000Z","size":28,"stargazers_count":9,"open_issues_count":0,"forks_count":7,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-31T12:11:10.778Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Haskell","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/pbrisbin.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.hs","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":"2014-11-13T23:09:16.000Z","updated_at":"2021-05-03T20:43:34.000Z","dependencies_parsed_at":"2022-08-21T21:50:59.563Z","dependency_job_id":null,"html_url":"https://github.com/pbrisbin/google-oauth2","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pbrisbin%2Fgoogle-oauth2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pbrisbin%2Fgoogle-oauth2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pbrisbin%2Fgoogle-oauth2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pbrisbin%2Fgoogle-oauth2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pbrisbin","download_url":"https://codeload.github.com/pbrisbin/google-oauth2/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248804765,"owners_count":21164127,"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":"2024-10-03T17:38:41.578Z","updated_at":"2025-04-20T00:31:29.030Z","avatar_url":"https://github.com/pbrisbin.png","language":"Haskell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Google OAuth2\n\nInteractive Google OAuth2 token negotiation\n\n## Usage\n\n```haskell\n{-# LANGUAGE OverloadedStrings #-}\n{-# LANGUAGE RecordWildCards #-}\n\nmodule Main (main) where\n\nimport Data.Aeson\nimport Data.Semigroup ((\u003c\u003e))\nimport Network.Google.OAuth2\nimport Network.HTTP.Simple\nimport Network.OAuth.OAuth2\nimport Data.Text.Encoding (encodeUtf8)\n\nmain :: IO ()\nmain = do\n    OAuth2Token{..} \u003c-\n      getAccessToken\n        \"\u003cCLIENT_ID\u003e\"      -- Fill with real ID.\n        \"\u003cCLIENT_SECRET\u003e\"  -- Fill with real code.\n        [\"https://www.googleapis.com/auth/drive\"]\n        (Just \"path/to/credentials.cache\")\n\n    request \u003c- parseRequest \"https://www.googleapis.com/drive/v2/files\"\n    response \u003c- httpJSON $ authorize (atoken accessToken) request\n\n    print (getResponseBody response :: Value)\n where\n   authorize token = setRequestHeaders\n       [ (\"Authorization\", encodeUtf8 $ \"Bearer \" \u003c\u003e token)\n       ]\n```\n\n## Prior Art\n\nThis module was inspired by [handa-gdata][] which appears to be abandoned.\n\n[handa-gdata]: http://hackage.haskell.org/package/handa-gdata\n\n---\n\n[CHANGELOG](./CHANGELOG.md) | [LICENSE](./LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpbrisbin%2Fgoogle-oauth2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpbrisbin%2Fgoogle-oauth2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpbrisbin%2Fgoogle-oauth2/lists"}