{"id":19230389,"url":"https://github.com/elmarx/mouflon","last_synced_at":"2026-04-16T01:33:07.782Z","repository":{"id":55762753,"uuid":"285604303","full_name":"elmarx/mouflon","owner":"elmarx","description":"Command-line OIDC client","archived":false,"fork":false,"pushed_at":"2025-08-26T18:35:39.000Z","size":41,"stargazers_count":4,"open_issues_count":2,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-03-18T22:30:37.425Z","etag":null,"topics":["cli","deno","keycloak","oidc"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/elmarx.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":"2020-08-06T15:19:50.000Z","updated_at":"2025-08-26T18:35:42.000Z","dependencies_parsed_at":"2022-08-15T06:50:31.182Z","dependency_job_id":null,"html_url":"https://github.com/elmarx/mouflon","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/elmarx/mouflon","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elmarx%2Fmouflon","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elmarx%2Fmouflon/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elmarx%2Fmouflon/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elmarx%2Fmouflon/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/elmarx","download_url":"https://codeload.github.com/elmarx/mouflon/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elmarx%2Fmouflon/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31867710,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-15T15:24:51.572Z","status":"ssl_error","status_checked_at":"2026-04-15T15:24:39.138Z","response_time":63,"last_error":"SSL_read: 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":["cli","deno","keycloak","oidc"],"created_at":"2024-11-09T15:38:01.917Z","updated_at":"2026-04-16T01:33:07.754Z","avatar_url":"https://github.com/elmarx.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🐑 Mouflon — CLI tool to get OIDC tokens\n\n\u003cimg align=\"right\" src=\"https://upload.wikimedia.org/wikipedia/commons/thumb/e/e5/Mouflon_Corse.jpg/300px-Mouflon_Corse.jpg\" /\u003e\n\nMouflon acts as an *OIDC client* to retrieve an **access token** from an OIDC provider.\n\nUpon initial execution, it opens a browser and executes the typical OIDC redirects to get an *access token*\nvia *authorization_code* grant.\n\nIf successful, it caches the *access token response* (thus both the *access token* and the *refresh token*), and then\nreturns the *access token* (as long as it's valid), or uses the *refresh token* to refresh the *access token* \nand of course return the new *access token*. If also the *refresh token* is expired, it again opens the browser to execute\nthe OIDC authorization.\n\n## Status\n\n*mouflon* works, but is pretty basic and not very flexible.\n\n- opening the browser works only in Linux and the fallback solution is implemented very naively\n- supports only keycloak, only a single realm and a single client\n- close to no error handling. So it will throw stack traces without any hints upon errors\n\nOf course all of these are possible future improvements :)  \n\n## Installation\n\nMouflon uses [*deno*](https://deno.land/), so make sure to have it [installed](https://deno.land/#installation).\n\nPlace file `mouflon.ts` into your `$PATH` (e.g. `~/bin`) and set the execution-bit (e.g. `chmod +x mouflon.ts`).\n\n## Configuration \n\n### Keycloak\n\nCreate an OIDC client (Standard flow enabled), should be \"confidential\", allow `http://localhost:4800/` as redirect URL.\n\nDownload the \"*Keycloak OIDC JSON*\" file available under the \"*Installation*\" tab.\n\n#### Example Terraform\n\n```hcl\nresource \"keycloak_openid_client\" \"mouflon\" {\n  realm_id = keycloak_realm.this.id\n\n  description = \"mouflon, a CLI tool to fetch tokens (https://github.com/elmarx/mouflon)\"\n\n  access_type = \"PUBLIC\"\n  client_id   = \"mouflon\"\n\n  standard_flow_enabled = true\n  valid_redirect_uris = [\n    \"http://localhost:4800/\"\n  ]\n}\n```\n\n### Mouflon\n\nCopy said JSON-file into `~/.config/mouflon/default.json` (if you set `$XDG_CONFIG_HOME` replace `~/.config` with that value).\n\nFuture versions could allow other configurations (selectable via CLI-arg) and other providers.\n\nCurrently, *mouflon* does **not** validate the JSON file.\n\n## Usage\n\nSimply execute `mouflon.ts` or `./mouflon.ts`\n\n## Examples\n\nfor bash\n\n```shell script\ncurl -H \"Authorization: Bearer $(mouflon.ts)\" https://example.com/protected\n```\n    \nor fish shell\n\n```shell script\nAT=(mouflon.ts) curl -H \"Authorization: Bearer $AT\" https://example.com/protected\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felmarx%2Fmouflon","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Felmarx%2Fmouflon","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felmarx%2Fmouflon/lists"}