{"id":18234127,"url":"https://github.com/bodrovis/omniauth-lokalise","last_synced_at":"2026-06-23T12:02:07.695Z","repository":{"id":62559511,"uuid":"486595218","full_name":"bodrovis/omniauth-lokalise","owner":"bodrovis","description":"Omniauth strategy for Lokalise","archived":false,"fork":false,"pushed_at":"2022-11-01T20:17:34.000Z","size":14,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-08-13T10:27:46.858Z","etag":null,"topics":["omniauth","omniauth-oauth2","omniauth-strategy"],"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/bodrovis.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-04-28T12:58:38.000Z","updated_at":"2022-08-29T14:53:33.000Z","dependencies_parsed_at":"2022-11-03T11:45:21.955Z","dependency_job_id":null,"html_url":"https://github.com/bodrovis/omniauth-lokalise","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/bodrovis/omniauth-lokalise","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bodrovis%2Fomniauth-lokalise","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bodrovis%2Fomniauth-lokalise/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bodrovis%2Fomniauth-lokalise/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bodrovis%2Fomniauth-lokalise/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bodrovis","download_url":"https://codeload.github.com/bodrovis/omniauth-lokalise/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bodrovis%2Fomniauth-lokalise/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274261910,"owners_count":25251958,"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","status":"online","status_checked_at":"2025-09-09T02:00:10.223Z","response_time":80,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["omniauth","omniauth-oauth2","omniauth-strategy"],"created_at":"2024-11-04T17:03:47.588Z","updated_at":"2026-06-23T12:02:02.648Z","avatar_url":"https://github.com/bodrovis.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Omniauth Lokalise\n\n![Gem](https://img.shields.io/gem/v/omniauth-lokalise)\n![CI](https://github.com/bodrovis/omniauth-lokalise/actions/workflows/ci.yml/badge.svg)\n\nThis is an official OmniAuth strategy for [https://lokalise.com](Lokalise).\n\n## Prerequisites\n\nAs the first step, you have to register a new OAuth 2 app at Lokalise by contacting the support team and providing the following info:\n\n* Title of your application\n* Logo of your application (150x150px, PNG or JPG)\n* Description of your application (optional)\n* Link to app website/documentation (optional)\n* Required scopes. Find the list required scopes for the corresponding API endpoints in the [Lokalise API docs](https://app.lokalise.com/api2docs/curl/). Please note that your can further adjust these scopes as needed when setting up Omniauth.\n\nAfter registering, you'll obtain a client ID and client secret. **Do not publicly expose your client secret!**\n\n[*Find detailed information in the Lokalise docs.*](https://docs.lokalise.com/en/articles/5574713-oauth-2)\n\n## Installation\n\nAdd a new gem to your `Gemfile`:\n\n```ruby\ngem 'omniauth-lokalise'\n```\n\nYou will also probably require the following gem:\n\n```ruby\ngem \"omniauth-rails_csrf_protection\"\n```\n\nRun:\n\n```\nbundle install\n```\n\n## Configuration\n\nCreate a new `config/initializers/omniauth.rb` file with the following contents:\n\n```ruby\nRails.application.config.middleware.use OmniAuth::Builder do\n  provider :lokalise, 'OAUTH2_CLIENT_ID', 'OAUTH2_CLIENT_SECRET',\n    scope: 'required_scopes'\nend\n```\n\nPaste your client ID, client secret and a list of scopes separated with spaces, for example: `'read_projects write_files'`.\n\n## Usage\n\nAdd a login button somewhere in your views (disable Turbo if you use it in your app):\n\n```html\n\u003c%= form_tag('/auth/lokalise', method: 'post', data: {turbo: false}) do %\u003e\n  \u003cbutton type='submit'\u003eLogin with Lokalise\u003c/button\u003e\n\u003c% end %\u003e\n```\n\nCreate a callback route:\n\n```ruby\nget '/auth/:provider/callback', to: 'sessions#create'\n```\n\nUse `request.env['omniauth.auth']` to fetch OAuth 2 access token and refresh token:\n\n```ruby\ntoken = request.env['omniauth.auth']['credentials']['token']\nrefresh_token = request.env['omniauth.auth']['credentials']['refresh_token']\n```\n\nPlease note that currently Lokalise does not provide any information about the logged in user except for credentials. In other words, you can't get access to the user name, uid, email, etc.\n\n## Using refresh token\n\nAccess tokens usually expire in 60 minutes but you can request a new one using refresh token. To achieve that, utilize [ruby-lokalise-api](https://github.com/lokalise/ruby-lokalise-api) client:\n\n```ruby\nrequire 'ruby_lokalise_api'\n\nauth_client = RubyLokaliseApi.auth_client 'OAUTH2_CLIENT_ID', 'OAUTH2_CLIENT_SECRET'\nresponse = auth_client.refresh 'YOUR_REFRESH_TOKEN'\ntoken = response['access_token']\n```\n\n## License\n\nThis gem is licensed under the [MIT license](./LICENSE).\n\n(c) 2022 Ilya Krukowski\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbodrovis%2Fomniauth-lokalise","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbodrovis%2Fomniauth-lokalise","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbodrovis%2Fomniauth-lokalise/lists"}