{"id":18489103,"url":"https://github.com/hachreak/oauth2_mongopool","last_synced_at":"2026-05-18T15:31:49.696Z","repository":{"id":139147453,"uuid":"47936014","full_name":"hachreak/oauth2_mongopool","owner":"hachreak","description":"A implementation of an OAuth2 backend with persistence on MongoDB made with mongopool.","archived":false,"fork":false,"pushed_at":"2018-03-31T16:13:35.000Z","size":2626,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-05-13T23:10:47.487Z","etag":null,"topics":["erlang","erlang-libraries","erlang-library","mongodb","oauth2"],"latest_commit_sha":null,"homepage":null,"language":"Erlang","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hachreak.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"COPYING","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":"2015-12-13T20:56:13.000Z","updated_at":"2022-09-13T15:37:24.000Z","dependencies_parsed_at":null,"dependency_job_id":"52b34f8a-6235-4c42-826a-19c0615d56a5","html_url":"https://github.com/hachreak/oauth2_mongopool","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/hachreak/oauth2_mongopool","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hachreak%2Foauth2_mongopool","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hachreak%2Foauth2_mongopool/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hachreak%2Foauth2_mongopool/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hachreak%2Foauth2_mongopool/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hachreak","download_url":"https://codeload.github.com/hachreak/oauth2_mongopool/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hachreak%2Foauth2_mongopool/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268023224,"owners_count":24183059,"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","status":"online","status_checked_at":"2025-07-31T02:00:08.723Z","response_time":66,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["erlang","erlang-libraries","erlang-library","mongodb","oauth2"],"created_at":"2024-11-06T12:55:17.351Z","updated_at":"2026-05-18T15:31:44.674Z","avatar_url":"https://github.com/hachreak.png","language":"Erlang","funding_links":[],"categories":[],"sub_categories":[],"readme":"oauth2_mongopool\n=====\n\n[![Build Status](https://travis-ci.org/hachreak/oauth2_mongopool.svg?branch=master)](https://travis-ci.org/hachreak/oauth2_mongopool)\n\nA implementation of an [OAuth2](https://github.com/kivra/oauth2) backend with\npersistence on `MongoDB` made with\n[mongopool](https://github.com/hachreak/mongopool).\n\nConfiguration\n-------------\n\n```erlang\n[\n  {mongopool, [\n    {pools, [\n      {mypool, [\n        {size, 10},\n        {max_overflow, 30}\n      ], [\n        {database, \u003c\u003c\"mydb\"\u003e\u003e},\n        {hostname, dbserver},\n        {login, \"myuser\"},\n        {password, \"mypassword\"},\n        {w_mode, safe}\n      ]}\n    ]}\n  ]},\n  {oauth2_mongopool, [\n    {pool, mypool}\n  ]},\n  {oauth2, [\n    {backend, oauth2_backend_mongopool}\n  ]}\n]\n```\n\nUsage\n-----\n\nAfter you configure [oauth2](https://github.com/kivra/oauth2) and\n[mongopool](https://github.com/hachreak/mongopool) as wrote before, you can\nstart the backend to ensure that `mongopool` is started.\n\n```erlang\napplication:ensure_all_started(oauth2_mongopool).\n{ok, AppCtx} = oauth2_mongopool:init().\n```\n\nThe `AppCtx` is the application context used when you call `oauth2` functions.\n\nE.g. to verify the access token:\n\n```erlang\ncase oauth2:verify_access_token(\u003c\u003cmytoken\u003e\u003e, AppCtx) of\n  {ok, } -\u003e true;\n  {error, _ErrType} -\u003e false\nend\n```\n\nBuild\n-----\n\n    $ utils/rebar3 compile\n\nTests\n-----\n\n    $ ./utils/rebar3 eunit\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhachreak%2Foauth2_mongopool","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhachreak%2Foauth2_mongopool","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhachreak%2Foauth2_mongopool/lists"}