https://github.com/hypersign-protocol/hs-wordpress-plugin
Plugin for wordpress to integrate passwordless login
https://github.com/hypersign-protocol/hs-wordpress-plugin
authentication hypersign identity wordpress wordpress-development wordpress-plugin
Last synced: about 2 months ago
JSON representation
Plugin for wordpress to integrate passwordless login
- Host: GitHub
- URL: https://github.com/hypersign-protocol/hs-wordpress-plugin
- Owner: hypersign-protocol
- Created: 2021-05-09T16:13:35.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2021-05-16T13:42:16.000Z (about 5 years ago)
- Last Synced: 2024-04-01T16:17:11.333Z (about 2 years ago)
- Topics: authentication, hypersign, identity, wordpress, wordpress-development, wordpress-plugin
- Language: PHP
- Homepage:
- Size: 62.5 KB
- Stars: 0
- Watchers: 4
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Hypersign Wordpress plugin

### Flow
* We can not integrate hypersign sdk in wp-backend because we can not write whole sdk in php - WP supports PHP.
* When a user opens the login page, the `wb-frontend` request a new challenge from `wp-backend`. The `wp-backend` requests that from `HS-WP-Server` by sending `AppID` and `AppSecret`.
* The `HS-WP-Server` connects with `HS-Subscription server` to verify the `AppID` and `AppSecret`.
* The `HS-WP-Server` then sends a new challenge along with other metadata like did, schema etc to the `WP-backend` or to the Hypersign plugin.
* The `Hypersign-plugin` at `WP-frontend` displays the QR code.
* The user scans the QR code and generates verifiable presentation
* Meanwhile `Hypersign-plugin` at `WP-frontend` keep polling the `WP-backend` about this challenge.
* The user sends the VP to the `WP-backend`, the `WP-backend` then again interacts with `HS-WP-Server` to verify the VP.
* The `HS-WP-Server` verifies the VP and sends the userdata back to `WP-backend` .
* The `WP-backend` responds to the polling request from frontend.
* The `WP-backend` checks if this user is already present in the db, if not it creates a new user in the db.
Note:
* The admin of the app has to comes to developer portal and get `AppID` and `AppSecret`.
* The admin then installs the `Hypersign WordPress Plugin` in the app.
## Installation
```
cd /var/www/html/wp-content/plugins/
git clone https://github.com/hypersign-protocol/hs-wordpress-plugin hypersign-auth
```
## /auth
### Request
```js
POST 192.168.43.43/index.php/wp-json/hs/api/v2/challenge
Body: {
"user": 123,
"name": "Vishwas anand",
"email": "vishu1@gmail.com"
}
```
### Response
```js
[
{
"user": 123,
"name": "Vishwas anand",
"email": "vishu1@gmail.com"
},
{
"challenge": "7d5a355f-40da-4635-91ad-ec4c15ebed00"
}
]
```
## /challenge
### Request
```js
GET 192.168.43.43/index.php/wp-json/hs/api/v2/challenge
```
### Response
```js
{
"status": 200,
"message": "success",
"error" : null
}
```