vk-auth-library
Advanced tools
Comparing version 1.0.1 to 1.0.2
{ | ||
"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});` | ||
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
9950