zied.hosni
zied.hosni

Reputation: 490

Hyper Ledger Composer , call REST API server side or client side

I'm working on Hyper Ledger Composer and integrating the REST API in a nodejs web app "using js client side to call the API " and I'm wondering how can I keep some interface private and prevent from show and post to it . Should I simply call the api server side before or is there an elegant way ?

Upvotes: 0

Views: 247

Answers (2)

Yogesh Jangir
Yogesh Jangir

Reputation: 37

There is another way to develop your own rest api using NodeJs sdk. You can connect to the network using Cards and perform any action using BusinessNetworkConnection class and factory object.

Read [https://hyperledger.github.io/composer/v0.16/applications/node][1]

Upvotes: 0

Paul O'Mahony
Paul O'Mahony

Reputation: 6740

To protect access to the REST APIS, you can implement an authentication strategy - see here https://hyperledger.github.io/composer/integrating/enabling-rest-authentication.html and https://hyperledger.github.io/composer/integrating/enabling-multiuser.html (the latter requires that authentication is enabled).

A tutorial on using one such strategy - eg using Google OAUTH2 as an auth provider - is shown here -> https://hyperledger.github.io/composer/next/tutorials/google_oauth2_rest

Upvotes: 1

Related Questions