PLYR[CONNECT]
The easiest way to authenticate users via Browser / In-App browser with various ways to give back authenticated data.
Endpoint of PLYR[CONNECT]
Mainnet : https://connect.plyr.network/
Testnet: https://connect-testnet.plyr.network/
The required params to send to endpoint
action
login approve loginAndApprove manageIPP
requestData
base64 encoded string of json.
Each action has itself json structure
The Action's requestData json structure
{
"gameId": "tester",
"expiresIn": "86400",
"mode": "redirect",
"callbackString": "callbackStringOfMyGame",
"callbackUrl": "https://connect-testnet.plyr.network/test/"
}{
"gameId": "tester",
"plyrId": "fennec2",
"tokens": [
"plyr",
"gamr"
],
"amounts": [
"2222",
"3333"
],
"expiresIn": "86400",
"mode": "redirect",
"callbackString": "callbackStringOfMyGame",
"callbackUrl": "https://connect-testnet.plyr.network/test/"
}How to select Mode
Redirect
Open a new tab of browser. After authenticated, it will redirect to "callbackUrl".
If you want to do a polling interval to wait user to authenticate themself. you can do it by adding an extra param "uid" and pass the random UUID or any. and callbackUrl can be "/over" to show that authentication is successful
and you can use /auth/read/[uid] endpoint to check the result every interval you want. (recommended 2 - 5 seconds)
Callback
Opena new tab of browser. After authenticated, it will callback (Server side to callbackUrl)
Opener
You can do a popup browser window. It will use "window.opener.postMessage" to callback the origin / opener.
It will do a postMessage with the following structure
After Authenticated you can addEventlistener('message') to capture the callbacked data
Iframe
You can do an iframe. It will use "window.parent.postMessage" to callback the parent.
It will do a postMessage with the following structure
After Authenticated you can addEventlistener('message') to capture the callbacked data
Last updated