{"id":15134065,"url":"https://github.com/ueberauth/ueberauth_vk","last_synced_at":"2025-10-23T09:31:22.759Z","repository":{"id":57556473,"uuid":"55360490","full_name":"ueberauth/ueberauth_vk","owner":"ueberauth","description":"vk.com OAuth2 Strategy for Überauth.","archived":false,"fork":false,"pushed_at":"2023-02-28T21:05:56.000Z","size":120,"stargazers_count":19,"open_issues_count":6,"forks_count":12,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-01-31T11:12:40.581Z","etag":null,"topics":["elixir","oauth2-strategy","ueberauth","vk","vkontakte"],"latest_commit_sha":null,"homepage":"https://hex.pm/packages/ueberauth_vk","language":"Elixir","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/ueberauth.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null},"funding":{"patreon":"sobolevn"}},"created_at":"2016-04-03T17:56:21.000Z","updated_at":"2023-09-01T08:53:09.000Z","dependencies_parsed_at":"2023-07-13T11:18:25.299Z","dependency_job_id":null,"html_url":"https://github.com/ueberauth/ueberauth_vk","commit_stats":null,"previous_names":["sobolevn/ueberauth_vk"],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ueberauth%2Fueberauth_vk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ueberauth%2Fueberauth_vk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ueberauth%2Fueberauth_vk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ueberauth%2Fueberauth_vk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ueberauth","download_url":"https://codeload.github.com/ueberauth/ueberauth_vk/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":237807468,"owners_count":19369597,"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":["elixir","oauth2-strategy","ueberauth","vk","vkontakte"],"created_at":"2024-09-26T05:02:15.622Z","updated_at":"2025-10-23T09:31:22.366Z","avatar_url":"https://github.com/ueberauth.png","language":"Elixir","funding_links":["https://patreon.com/sobolevn"],"categories":[],"sub_categories":[],"readme":"# Überauth VK\n\n[![Build Status](https://img.shields.io/travis/sobolevn/ueberauth_vk/master.svg)](https://travis-ci.org/sobolevn/ueberauth_vk) [![Coverage Status](https://coveralls.io/repos/github/sobolevn/ueberauth_vk/badge.svg?branch=master)](https://coveralls.io/github/sobolevn/ueberauth_vk?branch=master) [![Hex Version](https://img.shields.io/hexpm/v/ueberauth_vk.svg)](https://hex.pm/packages/ueberauth_vk) [![License](http://img.shields.io/badge/license-MIT-brightgreen.svg)](http://opensource.org/licenses/MIT)\n\n\u003e VK OAuth2 strategy for Überauth.\n\n## Requirements\n\nWe support `elixir` versions `1.4` and above.\n\n## Installation\n\n1. Setup your application at [VK Developers](https://vk.com/dev).\n\n2. Add `:ueberauth_vk` to your list of dependencies in `mix.exs`:\n\n    ```elixir\n    def deps do\n      # installation via hex:\n      [{:ueberauth_vk, \"~\u003e 0.3\"}]\n      # if you want to use github:\n      # [{:ueberauth_vk, github: \"sobolevn/ueberauth_vk\"}]\n    end\n    ```\n\n3. Add the strategy to your applications:\n\n    ```elixir\n    def application do\n      [applications: [:ueberauth_vk]]\n    end\n    ```\n\n4. Add VK to your Überauth configuration:\n\n    ```elixir\n    config :ueberauth, Ueberauth,\n      providers: [\n        vk: {Ueberauth.Strategy.VK, []}\n      ]\n    ```\n\n5.  Update your provider configuration:\n\n    ```elixir\n    config :ueberauth, Ueberauth.Strategy.VK.OAuth,\n      client_id: System.get_env(\"VK_CLIENT_ID\"),\n      client_secret: System.get_env(\"VK_CLIENT_SECRET\")\n    ```\n\n6.  Include the Überauth plug in your controller:\n\n    ```elixir\n    defmodule MyApp.AuthController do\n      use MyApp.Web, :controller\n      plug Ueberauth\n      ...\n    end\n    ```\n\n7.  Create the request and callback routes if you haven't already:\n\n    ```elixir\n    scope \"/auth\", MyApp do\n      pipe_through :browser\n\n      get \"/:provider\", AuthController, :request\n      get \"/:provider/callback\", AuthController, :callback\n    end\n    ```\n\n8. You controller needs to implement callbacks to deal with `Ueberauth.Auth` and `Ueberauth.Failure` responses.\n\nFor an example implementation see the [Überauth Example](https://github.com/ueberauth/ueberauth_example) application.\n\n## Customizing\n\nYou can customize [multiple fields](https://vk.com/dev/auth_sites), such as `default_scope`, `default_display`, `default_state`, `profile_fields`, and `uid_field`.\n\n### Scope\n\nBy default the requested scope is `\"public_profile\"`. Scope can be configured either explicitly as a `scope` query value on the request path or in your configuration:\n\n```elixir\nconfig :ueberauth, Ueberauth,\n  providers: [\n    vk: {Ueberauth.Strategy.VK, [default_scope: \"friends,video,offline\"]}\n  ]\n```\n\n### Profile Fields\n\nYou can also provide custom fields for user profile:\n\n```elixir\nconfig :ueberauth, Ueberauth,\n  providers: [\n    vk: {Ueberauth.Strategy.VK, [profile_fields: \"photo_200,location,online\"]}\n  ]\n```\n\nSee [VK API Method Reference \u003e User](https://vk.com/dev/users.get) for full list of fields.\n\n### State\n\nYou can also set the custom field called [`state`](https://github.com/sobolevn/ueberauth_vk/pull/20). It is used to prevent \"man in the middle\" attacks.\n\n```elixir\nconfig :ueberauth, Ueberauth,\n  providers: [\n    vk: {Ueberauth.Strategy.VK, [default_state: \"secret-state-value\"]}\n  ]\n```\n\nThis state will be passed to you in the callback as `/auth/vk?state=\u003csession_id\u003e` and will be available in the success struct.\n\n### UID Field\n\nYou can use alternate fields to identify users. For example, you can use `email`.\n\n```elixir\nconfig :ueberauth, Ueberauth,\n  providers: [\n    vk: {Ueberauth.Strategy.VK, [\n      default_scope: \"email\",\n      uid_field: :email\n    ]}\n  ]\n```\n\n\n## License\n\nMIT. Please see [LICENSE.md](https://github.com/sobolevn/ueberauth_vk/blob/master/LICENSE.md) for licensing details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fueberauth%2Fueberauth_vk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fueberauth%2Fueberauth_vk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fueberauth%2Fueberauth_vk/lists"}