{"id":29551327,"url":"https://github.com/doximity/omniauth-doximity-oauth2","last_synced_at":"2025-09-25T23:32:25.603Z","repository":{"id":37894914,"uuid":"476345644","full_name":"doximity/omniauth-doximity-oauth2","owner":"doximity","description":"OmniAuth strategy for Doximity","archived":false,"fork":false,"pushed_at":"2024-05-16T19:47:22.000Z","size":7151,"stargazers_count":2,"open_issues_count":4,"forks_count":2,"subscribers_count":55,"default_branch":"master","last_synced_at":"2025-07-03T15:56:16.521Z","etag":null,"topics":["api-client","authentication","gem"],"latest_commit_sha":null,"homepage":"","language":"Ruby","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/doximity.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2022-03-31T14:36:39.000Z","updated_at":"2025-06-29T02:14:27.000Z","dependencies_parsed_at":"2023-10-12T07:28:46.299Z","dependency_job_id":"de1ab2e7-71bd-4e0c-905b-34efd72463ed","html_url":"https://github.com/doximity/omniauth-doximity-oauth2","commit_stats":{"total_commits":7,"total_committers":4,"mean_commits":1.75,"dds":0.5714285714285714,"last_synced_commit":"8b9aa6b5cec816378c2b2d83af0117542d62fff9"},"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/doximity/omniauth-doximity-oauth2","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doximity%2Fomniauth-doximity-oauth2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doximity%2Fomniauth-doximity-oauth2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doximity%2Fomniauth-doximity-oauth2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doximity%2Fomniauth-doximity-oauth2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/doximity","download_url":"https://codeload.github.com/doximity/omniauth-doximity-oauth2/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doximity%2Fomniauth-doximity-oauth2/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265698011,"owners_count":23813123,"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":["api-client","authentication","gem"],"created_at":"2025-07-18T04:05:37.721Z","updated_at":"2025-09-25T23:32:20.571Z","avatar_url":"https://github.com/doximity.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Omniauth::DoximityOauth2\n\nOmniAuth strategy for Doximity.\n\nSign up for Doximity's API to get your OAuth credentials at: https://www.doximity.com/developers/api_signup\n\nFor more details on what tools we have available, read our developer docs: https://www.doximity.com/developers/documentation\n\n## Installation\n\nAdd to your `Gemfile`:\n\n```ruby\ngem 'omniauth-doximity-oauth2'\n```\n\nThen `bundle install`.\n\n## Usage\n\nHere's an example for adding the middleware to a Rails app in `config/initializers/omniauth.rb`:\n\n```ruby\nDOXIMITY_OMNIAUTH_SETUP = lambda do |env|\n  env['omniauth.strategy'].options[:client_id] = ENV[\"DOXIMITY_CLIENT_ID\"]\n  env['omniauth.strategy'].options[:client_secret] = ENV[\"DOXIMITY_CLIENT_SECRET\"]\n  env['omniauth.strategy'].options[:scope] = \"openid profile:read:basic profile:read:email\"\nend\n\nRails.application.config.middleware.use OmniAuth::Builder do\n  configure do |config|\n    config.path_prefix = '/auth'\n  end\n  provider :doximity_oauth2, setup: DOXIMITY_OMNIAUTH_SETUP\nend\n```\n\nTalk with the Doximity API team about what scopes you need for your application, and make sure to edit your OmniAuth initializer to request them.\n\nUpdate your `config/routes.rb` to support Doximity OmniAuth callbacks on your session controller:\n\n```ruby\nRails.application.routes.draw do\n  get \"/auth/:provider/callback\" =\u003e \"sessions#create\"\n  post \"/signout\" =\u003e \"sessions#destroy\"\n  get \"/auth/failure\" =\u003e \"sessions#failure\"\nend\n```\n\nThen, create a sign-in button that posts to `/auth/doximity`. Use one of the Sign in with Doximity logos, available here: https://www.doximity.com/developers/documentation#logos-for-use-by-third-party-developers\n\n```ruby\n\u003c%= link_to \"Sign in with Doximity\", \"/auth/doximity\", method: :post do %\u003e\n  \u003c%= image_tag \"https://assets.doxcdn.com/image/upload/v1/apps/doximity/api/api-button-sign-in-with-doximity.png\", alt: \"Sign in with Doximity button\"%\u003e\n\u003c% end %\u003e\n```\n\nNote that in OmniAuth versions 2 and above, links to sign in should use the POST method. Read more [here](https://github.com/omniauth/omniauth/wiki/Resolving-CVE-2015-9284)\n\nIn your callback controller, you will have a few resources available to you after the user approves your application and logs in.\n\n```ruby\nclass SessionsController \u003c ApplicationController\n  def create\n    session[:user_uuid] = request.env[\"omniauth.auth\"][\"uid\"]\n    redirect_to request.env[\"omniauth.origin\"] || \"/\", :notice =\u003e \"Signed in!\"\n  end\n\n  def destroy\n    session.delete(:user_uuid)\n    redirect_to \"/\"\n  end\n\n  def failure\n    redirect_to request.env[\"omniauth.origin\"] || \"/\", :alert =\u003e \"Authentication error: #{params[:message].humanize}\"\n  end\nend\n```\n\nYou can also add an `origin` param to your `/auth/doximity` post, which will be provided in the `request.env[\"omniauth.origin\"]` variable after the success or failure callback.\n\n## Configuration\n\nYou can configure several options, inside the configuration lambda:\n\n* `[:scope]`: A comma-separated list of permissions you want to request from the user.Caveats:\n  * The `openid` scope is suggested. Alternatively, if the `openid` scope is not requested `omniauth-doximity` will make an additional request to retrieve information about the signed in user using your other scopes. Your app may be subject to rate limiting depending on your usage.\n  * Without any scopes, you will still be able to log in the user and retrieve a unique UUIDv4 to distinguish them from other users.\n\n* `[:name]`: The name of the strategy. The default name is `doximity` but it can be changed to any string. The `:provider` part of OmniAuth  URLs will also change to `/auth/{{ name }}`.\n\n* `[:client_options][:site]`: Override the Doximity OAuth provider website. You may be provided with a development site to use while setting up your integration, which you would set here.\n\n* `[:pkce]`: A boolean denoting whether to follow the PKCE OAuth spec. Default `true`. Note that if set to false, your OmniAuth credentials hash will not include a `refresh` token. Your OAuth application also may require PKCE to use OmniAuth.\n\n## Auth Hash\n\nHere's an example of an authentication hash available in the callback by accessing `request.env['omniauth.auth']`:\n\n```ruby\n{\n  \"provider\" =\u003e \"doximity\",\n  \"uid\" =\u003e \"cc485bd2-b25a-4677-b05c-e98febf7789d\",\n  \"info\" =\u003e {\n    \"name\" =\u003e \"Test User\",\n    \"given_name\" =\u003e \"Test\",\n    \"family_name\" =\u003e \"User\",\n    \"primary_email\" =\u003e \"md@doximity.com\",\n    \"emails\" =\u003e [\"md@doximity.com\"],\n    \"profile_photo_url\" =\u003e \"http://res.cloudinary.com/doximity-development/image/upload/l_text:Helvetica_130_bold:AT,co_rgb:FFFFFF,t_profile_photo_320x320/profile-placeholder-registered-5.jpg\",\n    \"credentials\" =\u003e \"Other\",\n    \"specialty\" =\u003e \"Optometrist\"\n  },\n  \"credentials\" =\u003e {\n    \"token\" =\u003e \"gMej-ecC9Wzy4KkUCypYQ1J_8mQ1Yo9RXJYwU2kCyPKciuuOIxHflFlLP0PLlJmwnjPwlNa7nkQeeOcz-zyC6w==\",\n    \"refresh_token\" =\u003e \"go-40T6xPOzSOd09NTElQ0tGi-BU5hluljET8wa3syzxBqsG5BP0PJW_CsbDhmm49T081jhsIMnP-OQG8McYYPdOENc027K87gGSurOquANzx8qlo4hTJ903LNGpTZ6VcV1Ci0jomvJdH1NsCq5nLxeCy4dBctTZEMA-c3pOVZ0=\",\n    \"expires_at\" =\u003e 1650335410,\n    \"expires\" =\u003e true,\n    \"access_token\" =\u003e \"gMej-ecC9Wzy4KkUCypYQ1J_8mQ1Yo9RXJYwU2kCyPKciuuOIxHflFlLP0PLlJmwnjPwlNa7nkQeeOcz-zyC6w==\",\n    \"scope\" =\u003e \"profile:read:email profile:read:basic openid\",\n    \"token_type\" =\u003e \"bearer\"\n  }, \"extra\" =\u003e {\n    \"raw_subject_info\" =\u003e {\n      \"acr\" =\u003e 2, \"at_hash\" =\u003e \"uVfpy56HzI3J_dZR2kyxrQ\", \"aud\" =\u003e [\"https://auth.doximity.com\", \"6bd7e37e80fd06819ca13b268adea5fbe57446a9f9e1982f9483813d7272acf1\"], \"auth_time\" =\u003e 1650333376, \"azp\" =\u003e \"6bd7e37e80fd06819ca13b268adea5fbe57446a9f9e1982f9483813d7272acf1\", \"credentials\" =\u003e \"Other\", \"emails\" =\u003e [\"md@doximity.com\"], \"exp\" =\u003e 1650335384, \"family_name\" =\u003e \"User\", \"given_name\" =\u003e \"Test\", \"iat\" =\u003e 1650333610, \"iss\" =\u003e \"https://auth.doximity.com\", \"name\" =\u003e \"Test User\", \"primary_email\" =\u003e \"md@doximity.com\", \"profile_photo_url\" =\u003e \"http://res.cloudinary.com/doximity-development/image/upload/l_text:Helvetica_130_bold:AT,co_rgb:FFFFFF,t_profile_photo_320x320/profile-placeholder-registered-5.jpg\", \"sid\" =\u003e \"9\", \"specialty\" =\u003e \"Optometrist\", \"sub\" =\u003e \"cc485bd2-b25a-4677-b05c-e98febf7789d\"\n    }, \"raw_credential_info\" =\u003e {\n      \"token_type\" =\u003e \"bearer\", \"scope\" =\u003e \"profile:read:email profile:read:basic openid\", \"id_token\" =\u003e \"{{JWT omitted for brevity}}\", \"access_token\" =\u003e \"gMej-ecC9Wzy4KkUCypYQ1J_8mQ1Yo9RXJYwU2kCyPKciuuOIxHflFlLP0PLlJmwnjPwlNa7nkQeeOcz-zyC6w==\", \"refresh_token\" =\u003e \"go-40T6xPOzSOd09NTElQ0tGi-BU5hluljET8wa3syzxBqsG5BP0PJW_CsbDhmm49T081jhsIMnP-OQG8McYYPdOENc027K87gGSurOquANzx8qlo4hTJ903LNGpTZ6VcV1Ci0jomvJdH1NsCq5nLxeCy4dBctTZEMA-c3pOVZ0=\", \"expires_at\" =\u003e 1650335410\n    }\n  }\n}\n```\n\n## Contributing\n\n1. See [CONTRIBUTING.md](./CONTRIBUTING.md)\n2. Fork it\n3. Create your feature branch (`git checkout -b my-new-feature`)\n4. Commit your changes (`git commit -am 'Add some feature'`)\n5. Push to the branch (`git push origin my-new-feature`)\n6. Create a new Pull Request\n\n## License\n\nThe gem is licensed under an Apache 2 license. Contributors are required to sign a contributor license agreement. See [LICENSE.txt](./LICENSE.txt) and [CONTRIBUTING.md](./CONTRIBUTING.md) for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdoximity%2Fomniauth-doximity-oauth2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdoximity%2Fomniauth-doximity-oauth2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdoximity%2Fomniauth-doximity-oauth2/lists"}