{"id":18243192,"url":"https://github.com/mikeheft/auth0_current_user","last_synced_at":"2026-05-07T01:04:26.296Z","repository":{"id":45064964,"uuid":"301193912","full_name":"mikeheft/auth0_current_user","owner":"mikeheft","description":"Gem to facilitate the inclusion of Auth0 basic setup. Also provides a current_user method","archived":false,"fork":false,"pushed_at":"2022-01-11T14:29:28.000Z","size":41,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-08T19:24:29.495Z","etag":null,"topics":["auth0","auth0-jwt","authentication","rails"],"latest_commit_sha":null,"homepage":"","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/mikeheft.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-10-04T18:05:57.000Z","updated_at":"2024-08-01T13:48:15.000Z","dependencies_parsed_at":"2022-08-29T12:40:27.023Z","dependency_job_id":null,"html_url":"https://github.com/mikeheft/auth0_current_user","commit_stats":null,"previous_names":["mikeheft/auth0_current_user","mikeyduece/auth0_current_user"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/mikeheft/auth0_current_user","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikeheft%2Fauth0_current_user","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikeheft%2Fauth0_current_user/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikeheft%2Fauth0_current_user/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikeheft%2Fauth0_current_user/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mikeheft","download_url":"https://codeload.github.com/mikeheft/auth0_current_user/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikeheft%2Fauth0_current_user/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265562204,"owners_count":23788481,"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":["auth0","auth0-jwt","authentication","rails"],"created_at":"2024-11-05T08:03:39.413Z","updated_at":"2026-05-07T01:04:21.270Z","avatar_url":"https://github.com/mikeheft.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Auth0CurrentUser\n[![Gem Version](https://badge.fury.io/rb/auth0_current_user.svg)](https://badge.fury.io/rb/auth0_current_user)\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'auth0_current_user'\n```\n\nAnd then execute:\n\n    $ bundle install\n\nOr install it yourself as:\n\n    $ gem install auth0_current_user\n\n## Usage\n\nAfter including the gem in your Gemfile, run `rails g auth0_current_user:install` to install the initializer. This configuration of the gem is dependant on a couple of attributes:\n  * `client_id`\n    * This is the client id for your tenant. It is used to facilitate redirecting to the `/authorize` endpoint in `WebSecured` when the user's session has expired or is non-existant \n  * `auth0_domain`\n    * This is the domain from setting up your Auth0 application.\n  * `auth0_audience`\n    * This is the api identifier that you chose when creating your api(M2M) application\n  * `authenticated_klass`\n    * Defaults to `User`, but if you have a different model name for the class that will be logging in and being authenticate, be sure to change that in the initializer.\n    * accepted values are symbols or strings\n      * :user, 'user', :User, 'User'\n      * :my_user, 'my_user', :MyUser, 'MyUser'\n\nTo take advantage of the Auth0 authentication there are two flows you can use by simply including the relevant module in which ever controller you wish to lockdown.\n1. Web\n\n   a. `include Auth0CurrentUser::WebSecured` \n3. Api\n\n   a. `include Auth0CurrentUser::ApiSecured` \n  \nIn either case, you will have access to the `current_user` method. The `WebSecured` will check for `current_user` or `session['userinfo']` and the `ApiSecured` will check against the JsonWebToken being passed in.\n\n## Development\n\nAfter checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.\n\nTo install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/auth0_current_user. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/[USERNAME]/auth0_current_user/blob/master/CODE_OF_CONDUCT.md).\n\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).\n\n## Code of Conduct\n\nEveryone interacting in the Auth0CurrentUser project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/auth0_current_user/blob/master/CODE_OF_CONDUCT.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmikeheft%2Fauth0_current_user","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmikeheft%2Fauth0_current_user","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmikeheft%2Fauth0_current_user/lists"}