Excellent work alt! Where did you find the info for the websocket interface, from reading the code?
I'm just starting to design a BitShares authentication plugin for the Joomla CMS, and was going to use the standard RPC interface to the BitShares client. That will work, but since I'm starting from scratch it may make more sense to utilize the new websockets I/F.
I basically just need to validate a BitShares account name and perhaps later I'll get into obtaining account balances or other info to facilitate shopping cart transactions. If you could point me to any info about the websocket I/F I would greatly appreciate it.
Here are my initial thoughts:
Basic BitShares authentication scheme for Joomla
NOTE: the credentials of Joomla and BitShares use separate passwords but share the account name. A Joomla account must be created with its own password. The common binding is the Joomla username == a valid, authenticated BitShares account name. This avoids sending wallet password across the Internet, and allows for normal Joomla authentication without BitShares but provides an isolated integration of the BitShares ecosystem if the BitShares wallet is active and unlocked.
Prerequisite: BitShares config.json must be edited to enable RPC / websocket interface on localhost for access by javascript code in web browser.
Use case: (client side | Joomla server side)
1) User starts the BitShares wallet (either GUI or CMD Line version).
2) User interacts with BitShares (opens and unlocks the wallet or just logs into GUI).
3) User clicks the "login" link on Joomla website.
4) User enters username / password credentials into input fields of Joomla form and clicks submit.
5) Joomla server response back to browser is a block of client-side javascript code that will use RPC (or websocket?) calls to the local BitShares wallet (via AJAX) to validate the username is a valid BitShares account. Only the username is passed to the client from Joomla.
6) The client code in the browser will basically return validation TRUE or FALSE to Joomla. It may also return other info to Joomla, such as account balances (TBD).
7) If the username entered in the Joomla login form is verified to be a valid BitShares account, the Joomla BitShares authentication plugin will query the Joomla DB for the username. If it exists authentication is complete and the user is logged into Joomla. If not the plugin prompts the user for minimal Joomla account info (an email address or the std Joomla user registration form for the user to complete, but with username provided in step 4 as a read only field). If the form validates correctly a Joomla account now exists and authentication is complete for both Joomla and BitShares.
8 ) If the credentials are rejected the joomla BitShares plugin cascades down to the next active joomla auth plugin (if any). If there are no other auth methods configured, an "authentication failed" error message is displayed to user.
Excellent work alt! Where did you find the info for the websocket interface, from reading the code?
I'm just starting to design a BitShares authentication plugin for the Joomla CMS, and was going to use the standard RPC interface to the BitShares client. That will work, but since I'm starting from scratch it may make more sense to utilize the new websockets I/F.
I basically just need to validate a BitShares account name and perhaps later I'll get into obtaining account balances or other info to facilitate shopping cart transactions. If you could point me to any info about the websocket I/F I would greatly appreciate it.
Here are my initial thoughts:
Basic BitShares authentication scheme for Joomla
NOTE: the credentials of Joomla and BitShares use separate passwords but share the account name. A Joomla account must be created with its own password. The common binding is the Joomla username == a valid, authenticated BitShares account name. This avoids sending wallet password across the Internet, and allows for normal Joomla authentication without BitShares but provides an isolated integration of the BitShares ecosystem if the BitShares wallet is active and unlocked.
Prerequisite: BitShares config.json must be edited to enable RPC / websocket interface on localhost for access by javascript code in web browser.
Use case: (client side | Joomla server side)
1) User starts the BitShares wallet (either GUI or CMD Line version).
2) User interacts with BitShares (opens and unlocks the wallet or just logs into GUI).
3) User clicks the "login" link on Joomla website.
4) User enters username / password credentials into input fields of Joomla form and clicks submit.
5) Joomla server response back to browser is a block of client-side javascript code that will use RPC (or websocket?) calls to the local BitShares wallet (via AJAX) to validate the username is a valid BitShares account. Only the username is passed to the client from Joomla.
6) The client code in the browser will basically return validation TRUE or FALSE to Joomla. It may also return other info to Joomla, such as account balances (TBD).
7) If the username entered in the Joomla login form is verified to be a valid BitShares account, the Joomla BitShares authentication plugin will query the Joomla DB for the username. If it exists authentication is complete and the user is logged into Joomla. If not the plugin prompts the user for minimal Joomla account info (an email address or the std Joomla user registration form for the user to complete, but with username provided in step 4 as a read only field). If the form validates correctly a Joomla account now exists and authentication is complete for both Joomla and BitShares.
8 ) If the credentials are rejected the joomla BitShares plugin cascades down to the next active joomla auth plugin (if any). If there are no other auth methods configured, an "authentication failed" error message is displayed to user.
I haven't read your post in full (I appologize) but you may want to read
http://bytemaster.bitshares.org/article/2014/12/22/BitShares-Login/
If you haven't already