- 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 fromwp-backend
. Thewp-backend
requests that fromHS-WP-Server
by sendingAppID
andAppSecret
. - The
HS-WP-Server
connects withHS-Subscription server
to verify theAppID
andAppSecret
. - The
HS-WP-Server
then sends a new challenge along with other metadata like did, schema etc to theWP-backend
or to the Hypersign plugin. - The
Hypersign-plugin
atWP-frontend
displays the QR code. - The user scans the QR code and generates verifiable presentation
- Meanwhile
Hypersign-plugin
atWP-frontend
keep polling theWP-backend
about this challenge.
- Meanwhile
- The user sends the VP to the
WP-backend
, theWP-backend
then again interacts withHS-WP-Server
to verify the VP. - The
HS-WP-Server
verifies the VP and sends the userdata back toWP-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
andAppSecret
. - The admin then installs the
Hypersign WordPress Plugin
in the app.
cd /var/www/html/wp-content/plugins/
git clone https://github.com/hypersign-protocol/hs-wordpress-plugin hypersign-auth
POST 192.168.43.43/index.php/wp-json/hs/api/v2/challenge
Body: {
"user": 123,
"name": "Vishwas anand",
"email": "vishu1@gmail.com"
}
[
{
"user": 123,
"name": "Vishwas anand",
"email": "vishu1@gmail.com"
},
{
"challenge": "7d5a355f-40da-4635-91ad-ec4c15ebed00"
}
]
GET 192.168.43.43/index.php/wp-json/hs/api/v2/challenge
{
"status": 200,
"message": "success",
"error" : null
}