diff --git a/composer.json b/composer.json
index d02a066..1a65d4f 100644
--- a/composer.json
+++ b/composer.json
@@ -11,7 +11,7 @@
         "source": "http://cgit.drupalcode.org/social_auth_vk"
     },
     "require": {
-        "brutto/oauth2-vkontakte": "dev-brutto-patch-1"
+        "vkcom/vk-php-sdk": "^0.2.0"
     },
     "authors": [
         {
diff --git a/social_auth_vk.install b/social_auth_vk.install
index 20e45b3..4031e5c 100644
--- a/social_auth_vk.install
+++ b/social_auth_vk.install
@@ -23,7 +23,7 @@ function social_auth_vk_requirements($phase) {
   \Drupal::service('module_installer')->install(['social_api']);
 
   if ($phase == 'install') {
-    $requirements = SocialApiImplementerInstaller::checkLibrary('social_auth_vk', 'Social Auth Vkontakte', 'brutto/oauth2-vkontakte', 2.0, 3.0);
+    $requirements = SocialApiImplementerInstaller::checkLibrary('social_auth_vk', 'Social Auth Vkontakte', 'vkcom/vk-php-sdk', 0.2, 1.0);
   }
 
   return $requirements;
diff --git a/social_auth_vk.services.yml b/social_auth_vk.services.yml
index f738925..c4f2483 100644
--- a/social_auth_vk.services.yml
+++ b/social_auth_vk.services.yml
@@ -3,3 +3,4 @@ services:
     class: Drupal\social_auth_vk\VkontakteAuthManager
     arguments:
       - '@config.factory'
+      - '@request_stack'
diff --git a/src/Controller/VkontakteAuthController.php b/src/Controller/VkontakteAuthController.php
index 1cc593f..3a67406 100644
--- a/src/Controller/VkontakteAuthController.php
+++ b/src/Controller/VkontakteAuthController.php
@@ -4,6 +4,7 @@ namespace Drupal\social_auth_vk\Controller;
 
 use Drupal\Core\Controller\ControllerBase;
 use Drupal\social_api\Plugin\NetworkManager;
+use Drupal\social_api\SocialApiException;
 use Drupal\social_auth\SocialAuthDataHandler;
 use Drupal\social_auth\SocialAuthUserManager;
 use Drupal\social_auth_vk\VkontakteAuthManager;
@@ -77,7 +78,6 @@ class VkontakteAuthController extends ControllerBase {
    *   Used for logging errors.
    */
   public function __construct(NetworkManager $network_manager, SocialAuthUserManager $user_manager, VkontakteAuthManager $vkontakte_manager, RequestStack $request, SocialAuthDataHandler $social_auth_data_handler, LoggerChannelFactoryInterface $logger_factory) {
-
     $this->networkManager = $network_manager;
     $this->userManager = $user_manager;
     $this->vkontakteManager = $vkontakte_manager;
@@ -90,8 +90,6 @@ class VkontakteAuthController extends ControllerBase {
 
     // Sets the session keys to nullify if user could not logged in.
     $this->userManager->setSessionKeysToNullify(['access_token', 'oauth2state']);
-
-    $this->setting = $this->config('social_auth_vk.settings');
   }
 
   /**
@@ -108,85 +106,102 @@ class VkontakteAuthController extends ControllerBase {
     );
   }
 
+  /**
+   * Gets the underlying SDK library.
+   *
+   * @return \VK\OAuth\VKOAuth
+   *   The VKOAuth client.
+   *
+   * @throws \Drupal\Component\Plugin\Exception\PluginException
+   *   Thrown when no more class is applicable.
+   */
+  protected function getSdk() {
+    /** @var \Drupal\social_auth_vk\Plugin\Network\VkontakteAuth $plugin */
+    return $this->networkManager->createInstance('social_auth_vk')->getSdk();
+  }
+
   /**
    * Response for path 'user/login/vkontakte'.
    *
    * Redirects the user to Vkontakte for authentication.
+   *
+   * @return \Symfony\Component\HttpFoundation\RedirectResponse
+   *   Redirect response.
    */
   public function redirectToVkontakte() {
-    /* @var \J4k\OAuth2\Client\Provider\Vkontakte|false $vkontakte */
-    $vkontakte = $this->networkManager->createInstance('social_auth_vk')->getSdk();
+    try {
+      $vkontakte = $this->getSdk();
 
-    // If vkontakte client could not be obtained.
-    if (!$vkontakte) {
-      drupal_set_message($this->t('Social Auth Vkontakte not configured properly. Contact site administrator.'), 'error');
-      return $this->redirect('user.login');
-    }
+      // Vkontakte service was returned, inject it to $vkontakteManager.
+      $this->vkontakteManager->setOAuth($vkontakte);
 
-    // Vkontakte service was returned, inject it to $vkontakteManager.
-    $this->vkontakteManager->setClient($vkontakte);
+      // Generates the URL where the user will be redirected for Vkontakte login.
+      $vkontakte_login_url = $this->vkontakteManager->getAuthorizationUrl();
 
-    // Generates the URL where the user will be redirected for Vkontakte login.
-    $vkontakte_login_url = $this->vkontakteManager->getAuthorizationUrl();
+      $state = $this->vkontakteManager->getState();
 
-    $state = $this->vkontakteManager->getState();
+      $this->dataHandler->set('oauth2state', $state);
 
-    $this->dataHandler->set('oauth2state', $state);
+      $response = new TrustedRedirectResponse($vkontakte_login_url);
+    }
+    catch (\Exception $exception) {
+      drupal_set_message($this->t('Social Auth Vkontakte not configured properly. Contact site administrator.'), 'error');
+      \Drupal::logger('Social Auth Vkontakte')->error($exception->getMessage());
+      $response = $this->redirect('user.login');
+    }
 
-    return new TrustedRedirectResponse($vkontakte_login_url);
+    return $response;
   }
 
   /**
    * Response for path 'user/login/vkontakte/callback'.
    *
    * Vkontakte returns the user here after user has authenticated in Vkontakte.
+   *
+   * @return \Symfony\Component\HttpFoundation\RedirectResponse
+   *   Redirect response.
    */
   public function callback() {
-    // Checks if user cancel login via Vkontakte.
-    $error = $this->request->getCurrentRequest()->get('error');
-    if ($error == 'access_denied') {
-      drupal_set_message($this->t('You could not be authenticated.'), 'error');
-      return $this->redirect('user.login');
+    try {
+      // Checks if user cancel login via Vkontakte.
+      $error = $this->request->getCurrentRequest()->get('error');
+      if ($error === 'access_denied') {
+        throw new SocialApiException('You could not be authenticated.');
+      }
+
+      // Retreives $_GET['state'].
+      $state = $this->dataHandler->get('oauth2state');
+      $retrievedState = $this->request->getCurrentRequest()->query->get('state');
+      if (empty($retrievedState) || ($retrievedState !== $state)) {
+        $this->userManager->nullifySessionKeys();
+        throw new SocialApiException('Vkontakte login failed. Unvalid OAuth2 State.');
+      }
+
+      $vkontakte = $this->getSdk();
+      $this->vkontakteManager->setOAuth($vkontakte)->authenticate();
+
+      // Saves access token to session.
+      $this->dataHandler->set('access_token', $this->vkontakteManager->getAccessToken());
+
+      // Gets user's info from Vkontakte API.
+      $profile = $this->vkontakteManager->getUserInfo();
+      $full_name = $profile['first_name'] . ' ' . $profile['last_name'];
+
+      // Gets (or not) extra initial data.
+      $data = !$this->userManager->checkIfUserExists($profile['id'])
+        ? $this->vkontakteManager->getExtraDetails()
+        : [];
+
+      // If user information could be retrieved.
+      $response = $this->userManager->authenticateUser($full_name, $profile['email'], $profile['id'], $this->vkontakteManager->getAccessToken(), $profile['photo_max_orig'], $data);
     }
-
-    /* @var \J4k\OAuth2\Client\Provider\Vkontakte|false $vkontakte */
-    $vkontakte = $this->networkManager->createInstance('social_auth_vk')->getSdk();
-
-    // If Vkontakte client could not be obtained.
-    if (!$vkontakte) {
+    catch (\Exception $exception) {
       drupal_set_message($this->t('Social Auth Vkontakte not configured properly. Contact site administrator.'), 'error');
-      return $this->redirect('user.login');
-    }
-
-    $state = $this->dataHandler->get('oauth2state');
-
-    // Retreives $_GET['state'].
-    $retrievedState = $this->request->getCurrentRequest()->query->get('state');
-    if (empty($retrievedState) || ($retrievedState !== $state)) {
-      $this->userManager->nullifySessionKeys();
-      drupal_set_message($this->t('Vkontakte login failed. Unvalid OAuth2 State.'), 'error');
-      return $this->redirect('user.login');
+      \Drupal::logger('Social Auth Vkontakte')->error($exception->getMessage());
+      $response = $this->redirect('user.login');
     }
 
-    // Saves access token to session.
-    $this->dataHandler->set('access_token', $this->vkontakteManager->getAccessToken());
-
-    $this->vkontakteManager->setClient($vkontakte)->authenticate();
-
-    // Gets user's info from Vkontakte API.
-    if (!$profile = $this->vkontakteManager->getUserInfo()) {
-      drupal_set_message($this->t('Vkontakte login failed, could not load Vkontakte profile. Contact site administrator.'), 'error');
-      return $this->redirect('user.login');
-    }
-
-    // Gets (or not) extra initial data.
-    $data = $this->userManager->checkIfUserExists($profile->getId()) ? NULL : $this->vkontakteManager->getExtraDetails();
-
-    $info = $profile->toArray();
-    $full_name = $info['first_name'] . ' ' . $info['last_name'];
-
-    // If user information could be retrieved.
-    return $this->userManager->authenticateUser($full_name, '', $profile->getId(), $this->vkontakteManager->getAccessToken(), $info['photo_max_orig'], $data);
+    return $response;
   }
 
 }
diff --git a/src/Plugin/Network/VkontakteAuth.php b/src/Plugin/Network/VkontakteAuth.php
index c034ec1..eb690bf 100644
--- a/src/Plugin/Network/VkontakteAuth.php
+++ b/src/Plugin/Network/VkontakteAuth.php
@@ -11,8 +11,8 @@ use Drupal\social_api\Plugin\NetworkBase;
 use Drupal\social_api\SocialApiException;
 use Drupal\social_auth_vk\Settings\VkontakteAuthSettings;
 use Symfony\Component\DependencyInjection\ContainerInterface;
-use J4k\OAuth2\Client\Provider\Vkontakte;
 use Drupal\Core\Site\Settings;
+use VK\OAuth\VKOAuth;
 
 /**
  * Defines a Network Plugin for Social Auth Vkontakte.
@@ -33,6 +33,13 @@ use Drupal\Core\Site\Settings;
  */
 class VkontakteAuth extends NetworkBase implements VkontakteAuthInterface {
 
+  /**
+   * Stores the settings wrapper object.
+   *
+   * @var \Drupal\social_auth_vk\Settings\VkontakteAuthSettings
+   */
+  protected $settings;
+
   /**
    * The Social Auth Data Handler.
    *
@@ -122,39 +129,23 @@ class VkontakteAuth extends NetworkBase implements VkontakteAuthInterface {
   /**
    * Sets the underlying SDK library.
    *
-   * @return \J4k\OAuth2\Client\Provider\Vkontakte
+   * @return \VK\OAuth\VKOAuth;
    *   The initialized 3rd party library instance.
    *
    * @throws SocialApiException
    *   If the SDK library does not exist.
    */
   protected function initSdk() {
-
-    $class_name = 'J4k\OAuth2\Client\Provider\Vkontakte';
+    $class_name = VKOAuth::class;
     if (!class_exists($class_name)) {
-      throw new SocialApiException(sprintf('The Vkontakte Library for the league oAuth not found. Class: %s.', $class_name));
+      throw new SocialApiException(sprintf('The Vkontakte Library not found. Class: %s.', $class_name));
     }
-    /* @var \Drupal\social_auth_vk\Settings\VkontakteAuthSettings $settings */
-    $settings = $this->settings;
-    // Proxy configuration data for outward proxy.
-    $proxyUrl = $this->siteSettings->get('http_client_config')['proxy']['http'];
-
-    if ($this->validateConfig($settings)) {
-      // All these settings are mandatory.
-      $league_settings = [
-        'clientId' => $settings->getClientId(),
-        'clientSecret' => $settings->getClientSecret(),
-        'redirectUri' => $this->requestContext->getCompleteBaseUrl() . '/user/login/vkontakte/callback',
-      ];
-
-      if ($proxyUrl) {
-        $league_settings['proxy'] = $proxyUrl;
-      }
-
-      return new Vkontakte($league_settings);
+
+    if (!$this->validateConfig($this->settings)) {
+      throw new SocialApiException('Social Auth Vkontakte not configured properly. Contact site administrator.');
     }
 
-    return FALSE;
+    return new VKOAuth();
   }
 
   /**
@@ -170,14 +161,16 @@ class VkontakteAuth extends NetworkBase implements VkontakteAuthInterface {
   protected function validateConfig(VkontakteAuthSettings $settings) {
     $client_id = $settings->getClientId();
     $client_secret = $settings->getClientSecret();
-    if (!$client_id || !$client_secret) {
+
+    $is_valid = $client_id && $client_secret;
+
+    if (!$is_valid) {
       $this->loggerFactory
         ->get('social_auth_vk')
         ->error('Define Client ID and Client Secret on module settings.');
-      return FALSE;
     }
 
-    return TRUE;
+    return $is_valid;
   }
 
 }
diff --git a/src/VkontakteAuthManager.php b/src/VkontakteAuthManager.php
index 01bb029..619e119 100644
--- a/src/VkontakteAuthManager.php
+++ b/src/VkontakteAuthManager.php
@@ -2,81 +2,280 @@
 
 namespace Drupal\social_auth_vk;
 
-use Drupal\social_auth\AuthManager\OAuth2Manager;
+use Drupal\Core\Url;
 use Drupal\Core\Config\ConfigFactory;
+use Drupal\social_api\SocialApiException;
+use Drupal\social_auth\AuthManager\OAuth2Manager;
+use Symfony\Component\HttpFoundation\RequestStack;
+use VK\OAuth\VKOAuth;
+use VK\OAuth\VKOAuthDisplay;
+use VK\OAuth\Scopes\VKOAuthUserScope;
+use VK\OAuth\VKOAuthResponseType;
+use VK\Client\VKApiClient;
 
 /**
  * Contains all the logic for Vkontakte login integration.
  */
 class VkontakteAuthManager extends OAuth2Manager {
 
+  /**
+   * Authenticated user email.
+   *
+   * @var string
+   */
+  protected $email;
+
+  /**
+   * Authenticated user id.
+   *
+   * @var string
+   */
+  protected $userId;
+
+  /**
+   * The VKApi client.
+   *
+   * @var \VK\Client\VKApiClient
+   */
+  protected $client;
+
+  /**
+   * The OAuth client.
+   *
+   * @var \VK\OAuth\VKOAuth
+   */
+  protected $oauth;
+
+  /**
+   * The currently active request object.
+   *
+   * @var \Symfony\Component\HttpFoundation\Request
+   */
+  protected $request;
+
   /**
    * Constructor.
    *
    * @param \Drupal\Core\Config\ConfigFactory $configFactory
    *   Used for accessing configuration object factory.
    */
-  public function __construct(ConfigFactory $configFactory) {
+  public function __construct(ConfigFactory $configFactory, RequestStack $request_stack) {
     parent::__construct($configFactory->get('social_auth_vk.settings'));
+
+    $this->client = new VKApiClient();
+    $this->request = $request_stack->getCurrentRequest();
+  }
+
+  /**
+   * Set OAuth to authorization and authentication.
+   *
+   * @param \VK\OAuth\VKOAuth $oauth
+   *   VKOAuth object.
+   *
+   * @return \Drupal\social_auth_vk\VkontakteAuthManager
+   *   The current object.
+   */
+  public function setOAuth(VKOAuth $oauth) {
+    $this->oauth = $oauth;
+
+    return $this;
+  }
+
+  /**
+   * Set email for authenticated user.
+   *
+   * @param string $email
+   *   User email.
+   *
+   * @return \Drupal\social_auth_vk\VkontakteAuthManager
+   *   The current object.
+   */
+  public function setEmail($email) {
+    $this->email = $email;
+
+    return $this;
+  }
+
+  /**
+   * Get authenticated user email.
+   *
+   * @return string
+   *   User email.
+   */
+  public function getEmail() {
+    return $this->email;
+  }
+
+  /**
+   * Set authenticated user id.
+   *
+   * @param string $uid
+   *   User id.
+   *
+   * @return \Drupal\social_auth_vk\VkontakteAuthManager
+   *   The current object.
+   */
+  public function setUserId($uid) {
+    $this->userId = $uid;
+
+    return $this;
+  }
+
+  /**
+   * Get authenticated user id.
+   *
+   * @return string
+   *   User id.
+   */
+  public function getUserId() {
+    return $this->userId;
   }
 
   /**
    * {@inheritdoc}
    */
   public function authenticate() {
-    $this->setAccessToken($this->client->getAccessToken('authorization_code',
-      ['code' => $_GET['code']]));
+    $client_id = $this->getClientId();
+    $client_secret = $this->getClientSecret();
+    $redirect_uri = $this->getRedirectUrl();
+    $code = $this->request->query->get('code');
+
+    $response = $this->oauth->getAccessToken($client_id, $client_secret, $redirect_uri, $code);
+    if ($response) {
+      if (isset($response['access_token'])) {
+        $this->setAccessToken($response['access_token']);
+      }
+
+      if (isset($response['email'])) {
+        $this->setEmail($response['email']);
+      }
+
+      if (isset($response['user_id'])) {
+        $this->setUserId($response['user_id']);
+      }
+    }
   }
 
   /**
    * {@inheritdoc}
    */
   public function getUserInfo() {
-    return $this->client->getResourceOwner($this->getAccessToken());
+    $user_ids = [$this->getUserId()];
+    $fields = ['id', 'first_name', 'last_name', 'photo_max_orig'];
+
+    $profiles = $this->loadProfilesData($user_ids, $fields);
+    $profile = reset($profiles);
+    $profile['email'] = $this->getEmail();
+
+    return $profile;
   }
 
   /**
    * {@inheritdoc}
    */
   public function getAuthorizationUrl() {
-    $scopes = ['email'];
+    $client_id = $this->getClientId();
+    $redirect_uri = $this->getRedirectUrl();
+    $state = $this->getState();
+    $display = VKOAuthDisplay::PAGE;
 
-    $extra_scopes = $this->getScopes();
-    if ($extra_scopes) {
-      if (strpos($extra_scopes, ',')) {
-        $scopes = array_merge($scopes, explode(',', $extra_scopes));
-      }
-      else {
-        $scopes[] = $extra_scopes;
-      }
+    $scopes = [VKOAuthUserScope::EMAIL, VKOAuthUserScope::OFFLINE];
+    if ($extra_scopes = $this->getScopes()){
+      $scopes = array_merge($scopes, explode(',', $extra_scopes));
     }
 
-    // Returns the URL where user will be redirected.
-    return $this->client->getAuthorizationUrl([
-      'scope' => $scopes,
-    ]);
+    return $this->oauth->getAuthorizeUrl(VKOAuthResponseType::CODE, $client_id, $redirect_uri, $display, $scopes, $state);
   }
 
   /**
-   * {@inheritdoc}
+   * Load profiles data.
    *
-   * @todo: Implements this method correctly.
+   * @param array $user_ids
+   *   User ids.
+   * @param array $fields
+   *   Fields list to load.
+   *
+   * @return array
+   *   Profiles list.
+   *
+   * @throws \Drupal\social_api\SocialApiException
+   *   If profiles list is empty.
+   * @throws \VK\Exceptions\VKApiException
+   *   Wrong request data.
+   * @throws \VK\Exceptions\VKClientException
+   *   Request errors.
    */
-  public function requestEndPoint($path) {
-    $url = 'https://api.vk.com/method/' . $path . '&access_token=' . $this->getAccessToken();
+  protected function loadProfilesData($user_ids, $fields) {
+    $profiles = $this->client->users()->get($this->getAccessToken(), [
+      'fields' => $fields,
+      'user_ids' => $user_ids,
+    ]);
+
+    if (!$profiles) {
+      throw new SocialApiException('Vkontakte login failed, could not load Vkontakte profile.');
+    }
+
+    return $profiles;
+  }
 
-    $request = $this->client->getAuthenticatedRequest('GET', $url, $this->getAccessToken());
+  /**
+   * {@inheritdoc}
+   */
+  public function getExtraDetails() {
+    $user_ids = [$this->getUserId()];
+    $fields = [
+      'verified', 'sex', 'bdate', 'city', 'country', 'home_town', 'education',
+      'universities', 'schools',
+    ];
 
-    $response = $this->client->getResponse($request);
+    $profiles = $this->loadProfilesData($user_ids, $fields);
 
-    return $response->getBody()->getContents();
+    return reset($profiles);
   }
 
+  /**
+   * {@inheritdoc}
+   */
+  public function requestEndPoint($path) {}
+
   /**
    * {@inheritdoc}
    */
   public function getState() {
-    return $this->client->getState();
+    return 'secret_state_code';
+  }
+
+  /**
+   * Get client id.
+   *
+   * @return string
+   *   Client client id.
+   */
+  public function getClientId() {
+    return $this->settings->get('client_id');
+  }
+
+  /**
+   * Get client secret key.
+   *
+   * @return string
+   *   Client secret key.
+   */
+  public function getClientSecret() {
+    return $this->settings->get('client_secret');
+  }
+
+  /**
+   * Get redirect url.
+   *
+   * @return string
+   *   Redirect url.
+   */
+  public function getRedirectUrl() {
+    $callback_uri = Url::fromRoute('social_auth_vk.callback');
+    $callback_uri->setAbsolute();
+
+    return $callback_uri->toString(TRUE)->getGeneratedUrl();
   }
 
 }
