Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

vk-auth-library

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vk-auth-library - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

2

package.json
{
"name": "vk-auth-library",
"version": "1.0.1",
"version": "1.0.2",
"description": "This Library helps to do Authentication/Authorization using VK OAuth Or VK Open-ID securely in Backend",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -8,3 +8,3 @@ This package supports two different type of Server-Side Authentication/Authorization Using VK.

### OAuth
### OAuth
The client side implementation of this method is described in an article at VK: [Authorization Cod Flow](https://vk.com/dev/authcode_flow_user)

@@ -30,2 +30,4 @@

note that here the `redirect_uri` should be same as what is used in the client side and also what is defined in App setting.
then use the created client to get `access_token` and `user_id` and `user` data in the following way:

@@ -40,3 +42,4 @@

Note that you can only use the received code from the VK once and after that, it is expired. So if you plan to use other API methods too, use the following method first to get `access_token` and `user_id` and then use that **token** and **user id** to do other API method calls.
Note that you can only use the received code from the VK once and after that, it is expired.
So if you plan to use other API methods too, save `access_token` and `user_id` too. As an alternative you can use the following method first to get `access_token` and `user_id` and then use that **token** and **user id** to do other API method calls. If you want to get User can do it directly with following method in library

@@ -75,3 +78,3 @@ ```

const {session:{expire,mid,secret,sid,sig}}=response;
if (session) {
if (sig) {
fetch(`/auth/vk`, {

@@ -85,3 +88,3 @@ credentials: "include",

Here callback function in login should send the session data to backend.
Here callback function in login should send the session data to backend.
In the back you should add the library and use it as below:

@@ -103,4 +106,1 @@

3- Verify Login and Get User Data `client.verifyUserData({expire,mid,secret,sid,sig}).then(result=>{let user=result});`
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc