{"id":13879079,"url":"https://github.com/auth0/ruby-auth0","last_synced_at":"2025-04-11T03:29:37.372Z","repository":{"id":37444197,"uuid":"21049751","full_name":"auth0/ruby-auth0","owner":"auth0","description":"Ruby toolkit for Auth0 API","archived":false,"fork":false,"pushed_at":"2025-01-24T02:40:21.000Z","size":2224,"stargazers_count":202,"open_issues_count":21,"forks_count":138,"subscribers_count":101,"default_branch":"master","last_synced_at":"2025-04-03T19:50:22.569Z","etag":null,"topics":["authentication","dx-sdk","ruby"],"latest_commit_sha":null,"homepage":"https://auth0.com/","language":"Ruby","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/auth0.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2014-06-20T19:26:07.000Z","updated_at":"2025-04-01T00:50:50.000Z","dependencies_parsed_at":"2023-09-25T07:14:36.151Z","dependency_job_id":"84e7d50f-e895-4d2a-be1c-8954114510f7","html_url":"https://github.com/auth0/ruby-auth0","commit_stats":{"total_commits":771,"total_committers":100,"mean_commits":7.71,"dds":0.7833981841763943,"last_synced_commit":"aed1d67f9c9213b99a13f371e10ef8feebe7fee0"},"previous_names":[],"tags_count":51,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/auth0%2Fruby-auth0","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/auth0%2Fruby-auth0/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/auth0%2Fruby-auth0/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/auth0%2Fruby-auth0/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/auth0","download_url":"https://codeload.github.com/auth0/ruby-auth0/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248335236,"owners_count":21086540,"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":["authentication","dx-sdk","ruby"],"created_at":"2024-08-06T08:02:09.149Z","updated_at":"2025-04-11T03:29:37.339Z","avatar_url":"https://github.com/auth0.png","language":"Ruby","readme":"![ruby-auth0](https://cdn.auth0.com/website/sdks/banners/ruby-auth0-banner.png)\n\nRuby API client for the [Auth0](https://auth0.com) platform.\n\n[![CircleCI](https://img.shields.io/circleci/project/github/auth0/ruby-auth0/master.svg)](https://circleci.com/gh/auth0/ruby-auth0)\n[![Gem Version](https://badge.fury.io/rb/auth0.svg)](http://badge.fury.io/rb/auth0)\n[![codecov](https://codecov.io/gh/auth0/ruby-auth0/branch/master/graph/badge.svg)](https://codecov.io/gh/auth0/ruby-auth0)\n[![Yard Docs](http://img.shields.io/badge/yard-docs-blue.svg)](http://www.rubydoc.info/github/auth0/ruby-auth0/master/frames)\n[![MIT licensed](https://img.shields.io/dub/l/vibe-d.svg?style=flat)](https://github.com/auth0/ruby-auth0/blob/master/LICENSE)\n\n\u003cdiv\u003e\n📚 \u003ca href=\"#documentation\"\u003eDocumentation\u003c/a\u003e - 🚀 \u003ca href=\"#getting-started\"\u003eGetting started\u003c/a\u003e - 💻 \u003ca href=\"#api-reference\"\u003eAPI reference\u003c/a\u003e - 💬 \u003ca href=\"#feedback\"\u003eFeedback\u003c/a\u003e\n\u003c/div\u003e\n\n## Documentation\n\n- [API documentation](https://www.rubydoc.info/gems/auth0) - documentation auto-generated from the code comments that explains all the available features\n- [Examples](https://github.com/auth0/ruby-auth0/blob/master/EXAMPLES.md) - examples that demonstrate the different ways in which this SDK can be used\n- [Docs Site](https://auth0.com/docs) - explore our Docs site and learn more about Auth0\n\n## Getting Started\n\n### Installation\n\nThis gem can be installed directly:\n\n```bash\n$ gem install auth0\n```\n\nor with [Bundler](https://bundler.io/man/bundle-add.1.html):\n\n```bash\nbundle add auth0\n```\n\n### Usage\n\nCreate an instance of `Auth0Client` to access properties and methods of the authentication and management APIs:\n\n```ruby\nrequire 'auth0'\n\nclient = Auth0Client.new(\n  client_id: ENV['AUTH0_RUBY_CLIENT_ID'],\n  client_secret: ENV['AUTH0_RUBY_CLIENT_SECRET'],\n  domain: ENV['AUTH0_RUBY_DOMAIN'],\n  # If you pass in a client_secret value, the SDK will automatically try to get a\n  # Management API token for this application. Make sure your Application can make a\n  # Client Credentials grant (Application settings in Auth0 \u003e Advanced \u003e Grant Types\n  # tab) and that the Application is authorized for the Management API:\n  # https://auth0.com/docs/api-auth/config/using-the-auth0-dashboard\n  #\n  # Otherwise, you can pass in a Management API token directly for testing or temporary\n  # access using the key below.\n  # token: ENV['AUTH0_RUBY_API_TOKEN'],\n  #\n  # When passing a token, you can also specify when the token expires in seconds from epoch. Otherwise, expiry is set\n  # by default to an hour from now.\n  # token_expires_at: Time.now.to_i + 86400\n)\n```\n\nIf `token` is omitted, the SDK will attempt to fetch a new token using the `client_credentials` grant, provided that `client_id` and `client_secret` are provided in the configuration. Once the token is about to expire (or has already expired), a new token will be fetched and cached for future calls.\n\nFor this to work, ensure your application can make a Client Credentials grant (Application settings in Auth0 \u003e Advanced \u003e Grant Types tab) and that the application is authorized for the Management API: https://auth0.com/docs/api-auth/config/using-the-auth0-dashboard\n\n## Authentication API Client\n\nThis SDK provides access to [Authentication API](https://auth0.com/docs/api/authentication) endpoints with the `Auth0::API::AuthenticationEndpoints` module.\n\nFor basic login capability, we suggest using our OmniAuth stategy [detailed here](https://auth0.com/docs/quickstart/webapp/rails/01-login). Other authentication tasks currently supported are:\n\n- Register a new user with a database connection using the `signup` method.\n- Redirect a user to the universal login page for authentication using the `authorization_url` method.\n- Log a user into a highly trusted app with the [Resource Owner Password grant](https://auth0.com/docs/api-auth/tutorials/password-grant) using the `login` method.\n- Exchange an authorization code for an access token on callback using the `obtain_user_tokens` method (see the note on state validation below).\n- Send a change password email to a database connection user using the `change_password` method.\n- Log a user out of Auth0 with the `logout_url` method.\n\n**Important note on state validation**: If you choose to implement a login flow callback yourself, it is important to generate and store a `state` value, pass that value to Auth0 in the `authorization_url` method, and validate it in your callback URL before calling `obtain_user_tokens`. For more information on state validation, [please see our documentation](https://auth0.com/docs/protocols/oauth2/oauth-state).\n\nPlease note that this module implements endpoints that might be deprecated for newer tenants. If you have any questions about how and when the endpoints should be used, consult the [documentation](https://auth0.com/docs/api/authentication) or ask in our [Community forums](https://community.auth0.com/tags/wordpress).\n\n## Management API Client\n\nThis SDK provides access to the [Management API](https://auth0.com/docs/api/management/v2) via modules that help create clear and accurate calls. Most of the interaction is done through the `Auth0Client` class, instantiated with the required credentials.\n\nFor an example of using the management API client to read of users, see the [examples document](https://github.com/auth0/ruby-auth0/blob/master/EXAMPLES.md).\n\n## Further reading\n\n- [Login using OmniAuth](https://auth0.com/docs/quickstart/webapp/rails/01-login)\n- [API authentication in Ruby](https://auth0.com/docs/quickstart/backend/ruby)\n- [API authentication in Rails](https://auth0.com/docs/quickstart/backend/rails)\n- [Managing authentication with Auth0 (blog)](https://auth0.com/blog/rails-5-with-auth0/)\n- [Ruby on Rails workflow with Docker (blog)](https://auth0.com/blog/ruby-on-rails-killer-workflow-with-docker-part-1/)\n\n## Feedback\n\n### Contributing\n\nWe appreciate feedback and contribution to this repo! Before you get started, please see the following:\n\n- [Auth0's general contribution guidelines](https://github.com/auth0/open-source-template/blob/master/GENERAL-CONTRIBUTING.md)\n- [Auth0's code of conduct guidelines](https://github.com/auth0/open-source-template/blob/master/CODE-OF-CONDUCT.md)\n\n### Raise an issue\n\nTo provide feedback or report a bug, please [raise an issue on our issue tracker](https://github.com/auth0/ruby-auth0/issues).\n\n### Vulnerability Reporting\n\nPlease do not report security vulnerabilities on the public GitHub issue tracker. The [Responsible Disclosure Program](https://auth0.com/whitehat) details the procedure for disclosing security issues.\n\n---\n\n\u003cp align=\"center\"\u003e\n  \u003cpicture\u003e\n    \u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"https://cdn.auth0.com/website/sdks/logos/auth0_dark_mode.png\" width=\"150\"\u003e\n    \u003csource media=\"(prefers-color-scheme: light)\" srcset=\"https://cdn.auth0.com/website/sdks/logos/auth0_light_mode.png\" width=\"150\"\u003e\n    \u003cimg alt=\"Auth0 Logo\" src=\"https://cdn.auth0.com/website/sdks/logos/auth0_light_mode.png\" width=\"150\"\u003e\n  \u003c/picture\u003e\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n  Auth0 is an easy to implement, adaptable authentication and authorization platform. To learn more checkout \u003ca href=\"https://auth0.com/why-auth0\"\u003eWhy Auth0?\u003c/a\u003e\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n  This project is licensed under the MIT license. See the \u003ca href=\"https://github.com/auth0/ruby-auth0/blob/master/LICENSE\"\u003e LICENSE\u003c/a\u003e file for more info.\n\u003c/p\u003e\n","funding_links":[],"categories":["Ruby"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fauth0%2Fruby-auth0","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fauth0%2Fruby-auth0","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fauth0%2Fruby-auth0/lists"}