Digital Developer Conference: a FREE half-day online conference focused on AI & Cloud – North America: Nov 2 – India: Nov 9 – Europe: Nov 14 – Asia Nov 23 Register now

Close outline
  • United States
IBM?
  • Site map
IBM?
  • Marketplace

  • Close
    Search
  • Sign in
    • Sign in
    • Register
  • IBM Navigation
IBM Developer Answers
  • Spaces
    • Blockchain
    • IBM Cloud platform
    • Internet of Things
    • Predictive Analytics
    • Watson
    • See all spaces
  • Tags
  • Users
  • Badges
  • FAQ
  • Help
Close

Name

Community

  • Learn
  • Develop
  • Connect

Discover IBM

  • ConnectMarketplace
  • Products
  • Services
  • Industries
  • Careers
  • Partners
  • Support
10.190.13.195

Refine your search by using the following advanced search options.

Criteria Usage
Questions with keyword1 or keyword2 keyword1 keyword2
Questions with a mandatory word, e.g. keyword2 keyword1 +keyword2
Questions excluding a word, e.g. keyword2 keyword1 -keyword2
Questions with keyword(s) and a specific tag keyword1 [tag1]
Questions with keyword(s) and either of two or more specific tags keyword1 [tag1] [tag2]
To search for all posts by a user or all posts with a specific tag, start typing and choose from the suggestion list. Do not use a plus or minus sign with a tag, e.g., +[tag1].
  • Ask a question

WebSocket authentication/Security in Node-RED on Bluemix

310002E5A8 gravatar image
Question by RuchiraKariyawasam  (3) | Jan 17, 2017 at 07:31 AM securitynode-redauthenticationibmcloudwebsocketconnectwebsockets

We have Node-RED application server, which defines end points for both HTTP and Web socket connections.

IOS and NAO robot are the clients who connect to Node-RED. Clients can connect to bluemix by using both WS and WSS.

  1. How to stop WS connections and allow only WSS in bluemix ?

  2. Regarding the webSocket authentication, web socket protocol does not define header details. What are the possible ways in Node-RED ?

  3. Token based security is the alternative to resolve this issue. I have added node-red-contrib-auth npm to Node-RED and with that able to use the JsonWebToken node. JsonWebToken response provides token. Please let me know how to use token validation in Node-RED. (I only know the Node.js sample, http://iostreamer.me/ws/node.js/jwt/2016/05/08/websockets_authentication.html ) . Note : Think about the IOS and NAO-robot client is able to support.

People who like this

  0
Comment
10 |3000 characters needed characters left characters exceeded
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster

1 reply

  • Sort: 
060000DVN8 gravatar image

Answer by Chunlong Liang (263) | Jan 17, 2017 at 09:27 AM

For your question 3, Liberty can be configured to accept JsonWebToken (JWT) as authentication token, see http://www.ibm.com/support/knowledgecenter/SSD28V_9.0.0/com.ibm.websphere.wlp.core.doc/ae/twlp_sec_config_oidc_jwt.html

Comment

People who like this

  0   Show 5   Share
10 |3000 characters needed characters left characters exceeded
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
310002E5A8 gravatar image RuchiraKariyawasam (3)   Jan 18, 2017 at 06:41 AM 0
Share

With question 3. Yes. Java and Node.js clients can set headers.

In node.js client,

 var options = {headers : { "token": "12"} };
 ws = new WebSocket('wss://BluemixHost/wsTest1', options);

My issue is that headers are not visible in Node-RED web socket in node. How to view those headers and validate those in Node-RED ?

060000FRVE gravatar image Ralph Earle (1262)   Jan 18, 2017 at 10:37 AM 0
Share

@RuchiraKariyawasam, in case you do not get any further responses, consider asking your question again, based on what you now know. When a subject-matter expert sees that a question has been answered, they are less likely to give it attention.

060000FRVE gravatar image Ralph Earle (1262)   Jan 18, 2017 at 12:58 PM 0
Share

Follow-up question posted on Stack Overflow: http://stackoverflow.com/questions/41720123/disable-unsecure-websocket-calls-for-node-red-on-ibm-bluemix

310002E5A8 gravatar image RuchiraKariyawasam (3) Ralph Earle (1262)   Jan 18, 2017 at 10:28 PM 0
Share

Yes. you have shared the stackoverflow question raised by me. I will ask rest of questions one by one as you said. Thank you.

310002E5A8 gravatar image RuchiraKariyawasam (3) Ralph Earle (1262)   Jan 18, 2017 at 10:47 PM 0
Share

@RalphEarle : Anyway is that the approach we need to follow on IBM developer forum. It is opposite of stackoverflow since it is duplicate questions.

Follow this question

132 people are following this question.

Answers

Answers & comments

Related questions

Streaming Speech to Text websocket fails with 500 error (python3) why? 1 Answer

Websocket terminates after 2 minutes of pushing tuples 1 Answer

For Node-RED in Bluemix, how can I protect email credentials? 3 Answers

Address for accessing TCP socket and port in NODE RED BlueMix 2 Answers

private chat using node-red on bluemix 0 Answers

  • Contact
  • Privacy
  • IBM Developer Terms of use
  • Accessibility
  • Report Abuse
  • Cookie Preferences

Powered by AnswerHub

Authentication check. Please ignore.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • API Connect
  • Analytic Hybrid Cloud Core
  • Application Performance Management
  • Appsecdev
  • BPM
  • Blockchain
  • Business Transaction Intelligence
  • CAPI
  • CAPI SNAP
  • CICS
  • Cloud Analytics
  • Cloud Automation
  • Cloud Object Storage
  • Cloud marketplace
  • Collaboration
  • Content Services (ECM)
  • Continuous Testing
  • Courses
  • Customer Experience Analytics
  • DB2 LUW
  • Data and AI
  • DataPower
  • Decision Optimization
  • DevOps Build
  • DevOps Services
  • Developers IBM MX
  • Digital Commerce
  • Digital Experience
  • Finance
  • Global Entrepreneur Program
  • Hadoop
  • Hybrid Cloud Core
  • Hyper Protect
  • IBM Cloud platform
  • IBM Design
  • IBM Forms Experience Builder
  • IBM Maximo Developer
  • IBM StoredIQ
  • IBM StoredIQ-Cartridges
  • IIDR
  • ITOA
  • InformationServer
  • Integration Bus
  • Internet of Things
  • Kenexa
  • Linux on Power
  • LinuxONE
  • MDM
  • Mainframe
  • Messaging
  • Node.js
  • ODM
  • Open
  • PartnerWorld Developer Support
  • PowerAI
  • PowerVC
  • Predictive Analytics
  • Product Insights
  • PureData for Analytics
  • Push
  • QRadar App Development
  • Run Book Automation
  • Search Insights
  • Security Core
  • Storage
  • Storage Core
  • Streamsdev
  • Supply Chain Business Network
  • Supply Chain Insights
  • Swift
  • UBX Capture
  • Universal Behavior Exchange
  • UrbanCode
  • WASdev
  • WSRR
  • Watson
  • Watson Campaign Automation
  • Watson Content Hub
  • Watson Marketing Insights
  • dW Answers Help
  • dW Premium
  • developerWorks Sandbox
  • developerWorks Team
  • Watson Health
  • More
  • Tags
  • Questions
  • Users
  • Badges