{"id":15099128,"url":"https://github.com/casbin/auth0-role-manager","last_synced_at":"2025-10-09T11:15:12.071Z","repository":{"id":57488146,"uuid":"121079856","full_name":"casbin/auth0-role-manager","owner":"casbin","description":"Auth0 role manager for Casbin","archived":false,"fork":false,"pushed_at":"2023-08-06T14:07:28.000Z","size":11,"stargazers_count":16,"open_issues_count":1,"forks_count":9,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-10T18:47:47.943Z","etag":null,"topics":["access-control","auth","auth0","auth0-api","auth0-extend","authorization","casbin","role-manager"],"latest_commit_sha":null,"homepage":"https://github.com/casbin/casbin","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/casbin.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,"governance":null}},"created_at":"2018-02-11T03:24:35.000Z","updated_at":"2025-01-28T03:32:26.000Z","dependencies_parsed_at":"2022-09-21T07:52:41.081Z","dependency_job_id":"bb3d3749-c8c3-4122-b511-a13e0dbffaa4","html_url":"https://github.com/casbin/auth0-role-manager","commit_stats":{"total_commits":9,"total_committers":1,"mean_commits":9.0,"dds":0.0,"last_synced_commit":"f4fd1ffb6a9138e2de8a94f053ac76f22fa0e290"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/casbin%2Fauth0-role-manager","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/casbin%2Fauth0-role-manager/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/casbin%2Fauth0-role-manager/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/casbin%2Fauth0-role-manager/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/casbin","download_url":"https://codeload.github.com/casbin/auth0-role-manager/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248974644,"owners_count":21192186,"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":["access-control","auth","auth0","auth0-api","auth0-extend","authorization","casbin","role-manager"],"created_at":"2024-09-25T17:06:09.302Z","updated_at":"2025-10-09T11:15:07.041Z","avatar_url":"https://github.com/casbin.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"Auth0 Role Manager [![Build Status](https://travis-ci.org/casbin/auth0-role-manager.svg?branch=master)](https://travis-ci.org/casbin/auth0-role-manager) [![Coverage Status](https://coveralls.io/repos/github/casbin/auth0-role-manager/badge.svg?branch=master)](https://coveralls.io/github/casbin/auth0-role-manager?branch=master) [![Godoc](https://godoc.org/github.com/casbin/auth0-role-manager?status.svg)](https://godoc.org/github.com/casbin/auth0-role-manager)\n====\n\nAuth0 Role Manager is the [Auth0](https://auth0.com/) role manager for [Casbin](https://github.com/casbin/casbin). With this library, Casbin can load role hierarchy (user-role mapping) from [Auth0 Authorization Extension](https://auth0.com/docs/extensions/authorization-extension/v2) or save role hierarchy to it (NOT Implemented).\n\n## Installation\n\n    go get github.com/casbin/auth0-role-manager\n\n## Simple Example\n\n```go\npackage main\n\nimport (\n\t\"github.com/casbin/auth0-role-manager\"\n\t\"github.com/casbin/casbin\"\n)\n\nfunc main() {\n\t// This role manager dose not rely on Casbin policy. So we should not\n\t// specify grouping policy (\"g\" policy rules) in the .csv file.\n\te := casbin.NewEnforcer(\"examples/rbac_model.conf\", \"examples/rbac_policy.csv\")\n\n\t// Use our role manager.\n\t// clientID is the Client ID.\n\t// clientSecret is the Client Secret.\n\t// tenant is your tenant name. If your domain is: abc.auth0.com, then abc is your tenant name.\n\t// apiEndpoint is the base URL for your Auth0 Authorization Extension, it should\n\t// be something like: \"https://abc.us.webtask.io/adf6e2f2b84784b57522e3b19dfc9201\", there is\n\t// no \"/admins\", \"/admins/login\", \"/users\" or \"/api\" in the end.\n\trm := auth0rolemanager.NewRoleManager(\n\t\t\"your_client_id\",\n\t\t\"your_client_secret\",\n\t\t\"your_tenant_name\",\n\t\t\"your_base_url_for_auth0_authorization_extension\")\n\te.SetRoleManager(rm)\n\n\t// If our role manager relies on Casbin policy (like reading \"g\"\n\t// policy rules), then we have to set the role manager before loading\n\t// policy.\n\t//\n\t// Otherwise, we can set the role manager at any time, because role\n\t// manager has nothing to do with the adapter.\n\te.LoadPolicy()\n\t\n\t// Check the permission.\n\t// Casbin's subject (user) name uses the Auth0 user's Email field (like \"alice@test.com\").\n\t// Casbin's role name uses the Auth0 group's Name field (like \"Group1\", \"Group2\").\n\te.Enforce(\"alice@test.com\", \"data1\", \"read\")\n}\n```\n\n## Getting Help\n\n- [Casbin](https://github.com/casbin/casbin)\n\n## License\n\nThis project is under Apache 2.0 License. See the [LICENSE](LICENSE) file for the full license text.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcasbin%2Fauth0-role-manager","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcasbin%2Fauth0-role-manager","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcasbin%2Fauth0-role-manager/lists"}