{"id":17964782,"url":"https://github.com/erlef/oidcc_cowboy","last_synced_at":"2025-12-11T23:44:24.024Z","repository":{"id":45062554,"uuid":"73052703","full_name":"erlef/oidcc_cowboy","owner":"erlef","description":"Cowboy OpenId Connect support by using oidcc","archived":false,"fork":false,"pushed_at":"2025-08-06T08:20:10.000Z","size":3912,"stargazers_count":4,"open_issues_count":0,"forks_count":11,"subscribers_count":8,"default_branch":"main","last_synced_at":"2025-08-06T10:13:29.068Z","etag":null,"topics":["cowboy","erlang","openid","openid-client","openid-connect","security-wg"],"latest_commit_sha":null,"homepage":"https://hexdocs.pm/oidcc_cowboy","language":"Erlang","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/erlef.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/CONTRIBUTING.md","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,"zenodo":null},"funding":{"custom":["https://members.erlef.org/join-us","https://erlef.org/sponsors#become-a-sponsor"]}},"created_at":"2016-11-07T07:26:09.000Z","updated_at":"2025-08-06T08:20:13.000Z","dependencies_parsed_at":"2024-01-18T09:04:08.881Z","dependency_job_id":"1a6f7b7c-9485-42dd-ab9e-5ca7b4a5e970","html_url":"https://github.com/erlef/oidcc_cowboy","commit_stats":{"total_commits":98,"total_committers":8,"mean_commits":12.25,"dds":0.4285714285714286,"last_synced_commit":"0f8f314dcfd6fa4dd35307c294a8357441da3319"},"previous_names":["indigo-dc/oidcc_cowboy"],"tags_count":14,"template":false,"template_full_name":null,"purl":"pkg:github/erlef/oidcc_cowboy","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erlef%2Foidcc_cowboy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erlef%2Foidcc_cowboy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erlef%2Foidcc_cowboy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erlef%2Foidcc_cowboy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/erlef","download_url":"https://codeload.github.com/erlef/oidcc_cowboy/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erlef%2Foidcc_cowboy/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270705309,"owners_count":24631453,"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-08-16T02:00:11.002Z","response_time":91,"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":["cowboy","erlang","openid","openid-client","openid-connect","security-wg"],"created_at":"2024-10-29T12:08:36.447Z","updated_at":"2025-12-11T23:44:18.972Z","avatar_url":"https://github.com/erlef.png","language":"Erlang","funding_links":["https://members.erlef.org/join-us","https://erlef.org/sponsors#become-a-sponsor"],"categories":[],"sub_categories":[],"readme":"\u003cdiv style=\"margin-right: 15px; float: left;\"\u003e\n  \u003cimg\n    align=\"left\"\n    src=\"assets/logo.svg\"\n    alt=\"OpenID Connect Logo\"\n    width=\"170px\"\n  /\u003e\n\u003c/div\u003e\n\n# oidcc_cowboy\n\nCowboy callback module for easy integration of OpenId Connect, using [oidcc](https://github.com/erlef/oidcc).\n\n[![EEF Security WG project](https://img.shields.io/badge/EEF-Security-black)](https://github.com/erlef/security-wg)\n[![Main Branch](https://github.com/erlef/oidcc_cowboy/actions/workflows/branch_main.yml/badge.svg?branch=main)](https://github.com/erlef/oidcc_cowboy/actions/workflows/branch_main.yml)\n[![Module Version](https://img.shields.io/hexpm/v/oidcc_cowboy.svg)](https://hex.pm/packages/oidcc_cowboy)\n[![Total Download](https://img.shields.io/hexpm/dt/oidcc_cowboy.svg)](https://hex.pm/packages/oidcc_cowboy)\n[![License](https://img.shields.io/hexpm/l/oidcc_cowboy.svg)](https://github.com/erlef/oidcc_cowboy/blob/main/LICENSE)\n[![Last Updated](https://img.shields.io/github/last-commit/erlef/oidcc_cowboy.svg)](https://github.com/erlef/oidcc_cowboy/commits/master)\n[![Coverage Status](https://coveralls.io/repos/github/erlef/oidcc_cowboy/badge.svg?branch=main)](https://coveralls.io/github/erlef/oidcc_cowboy?branch=main)\n\n\u003cbr clear=\"left\"/\u003e\n\n\u003cpicture style=\"margin-right: 15px; float: left;\"\u003e\n  \u003csource\n    media=\"(prefers-color-scheme: dark)\"\n    srcset=\"assets/certified-dark.svg\"\n    width=\"170px\"\n    align=\"left\"\n  /\u003e\n  \u003csource\n    media=\"(prefers-color-scheme: light)\"\n    srcset=\"assets/certified-light.svg\"\n    width=\"170px\"\n    align=\"left\"\n  /\u003e\n  \u003cimg\n    src=\"assets/certified-light.svg\"\n    alt=\"OpenID Connect Certified Logo\"\n    width=\"170px\"\n    align=\"left\"\n  /\u003e\n\u003c/picture\u003e\n\nOpenID Certified by [Jonatan Männchen](https://github.com/maennchen) at the\n[Erlang Ecosystem Foundation](https://github.com/erlef) of multiple Relaying\nParty conformance profiles of the OpenID Connect protocol:\nFor details, check the\n[Conformance Test Suite](https://github.com/erlef/oidcc_conformance).\n\n\u003cbr clear=\"left\"/\u003e\n\n\u003cpicture style=\"margin-right: 15px; float: left;\"\u003e\n  \u003csource\n    media=\"(prefers-color-scheme: dark)\"\n    srcset=\"assets/erlef-logo-dark.svg\"\n    width=\"170px\"\n    align=\"left\"\n  /\u003e\n  \u003csource\n    media=\"(prefers-color-scheme: light)\"\n    srcset=\"assets/erlef-logo-light.svg\"\n    width=\"170px\"\n    align=\"left\"\n  /\u003e\n  \u003cimg\n    src=\"assets/erlef-logo-light.svg\"\n    alt=\"Erlang Ecosystem Foundation Logo\"\n    width=\"170px\"\n    align=\"left\"\n  /\u003e\n\u003c/picture\u003e\n\nThe refactoring for `v2` and the certification is funded as an\n[Erlang Ecosystem Foundation](https://erlef.org/) stipend entered by the\n[Security Working Group](https://erlef.org/wg/security).\n\n\u003cbr clear=\"left\"/\u003e\n\n## Usage\n\n### Code Flow\n\n```erlang\n-module(basic_client_app).\n-behaviour(application).\n\n-export([start/2]).\n-export([stop/1]).\n\nstart(_, _) -\u003e\n    OidccCowboyOpts = #{\n        provider =\u003e config_provider_gen_server_name,\n        client_id =\u003e \u003c\u003c\"client_id\"\u003e\u003e,\n        client_secret =\u003e \u003c\u003c\"client_secret\"\u003e\u003e,\n        redirect_uri =\u003e \"http://localhost:8080/oidc/return\"\n    },\n    OidccCowboyCallbackOpts = maps:merge(OidccCowboyOpts, #{\n        handle_success =\u003e fun(Req, _Token, #{\u003c\u003c\"sub\"\u003e\u003e := Subject}) -\u003e\n            cowboy_req:reply(200, #{}, [\"Hello \", Subject, \"!\"], Req)\n        end\n    }),\n    Dispatch = cowboy_router:compile([\n        {'_', [\n            {\"/\", oidcc_cowboy_authorize, OidccCowboyOpts},\n            {\"/oidc/return\", oidcc_cowboy_callback, OidccCowboyCallbackOpts}\n        ]}\n    ]),\n    {ok, _} = cowboy:start_clear(http, [{port, 8080}], #{\n        env =\u003e #{dispatch =\u003e Dispatch}\n    }),\n    basic_client_sup:start_link().\n\nstop(_) -\u003e\n    ok.\n```\n\n### Authorization Header Checking\n\n```erlang\n-module(api_client_app).\n-behaviour(application).\n\n-export([start/2]).\n-export([stop/1]).\n\nstart(_, _) -\u003e\n    OidccCowboyOpts = #{\n        provider =\u003e config_provider_gen_server_name,\n        client_id =\u003e \u003c\u003c\"client_id\"\u003e\u003e,\n        client_secret =\u003e \u003c\u003c\"client_secret\"\u003e\u003e\n    },\n    Dispatch = cowboy_router:compile([\n        {'_', [\n            {\"/\", api_client, #{}}\n        ]}\n    ]),\n    {ok, _} = cowboy:start_clear(http, [{port, 8080}], #{\n        env =\u003e #{\n            dispatch =\u003e Dispatch,\n            oidcc_cowboy_load_userinfo =\u003e OidccCowboyOpts,\n            oidcc_cowboy_introspect_token =\u003e OidccCowboyOpts,\n            oidcc_cowboy_validate_jwt_token =\u003e OidccCowboyOpts,\n        },\n        middlewares =\u003e [\n            oidcc_cowboy_extract_authorization,\n            oidcc_cowboy_load_userinfo, %% Check Token via Userinfo\n            oidcc_cowboy_introspect_token, %% Check Token via Introspection\n            oidcc_cowboy_validate_jwt_token, %% Check Token via JWT validation\n            cowboy_router,\n            cowboy_handler\n        ]\n    }),\n    api_client_sup:start_link().\n\nstop(_) -\u003e\n    ok.\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ferlef%2Foidcc_cowboy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ferlef%2Foidcc_cowboy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ferlef%2Foidcc_cowboy/lists"}