[{"id":"e7f3d7ab.aabfe8","type":"http in","z":"4e941abb.909174","name":"Application API","url":"app","method":"get","upload":false,"swaggerDoc":"","x":100,"y":80,"wires":[["480e0a55.a7290c"]]},{"id":"480e0a55.a7290c","type":"template","z":"4e941abb.909174","name":"","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"\n \n

API Accessed Successfully!

\n Try another OAuth scheme!
\n Configure again!\n \n","output":"str","x":340,"y":80,"wires":[["7a672aa2.ccea8c"]]},{"id":"7a672aa2.ccea8c","type":"http response","z":"4e941abb.909174","name":"","statusCode":"","headers":{},"x":590,"y":80,"wires":[]},{"id":"fb781f6c.7a1b4","type":"http request","z":"4e941abb.909174","name":"Call APIConnect Authorize","method":"POST","ret":"txt","paytoqs":false,"url":"","tls":"","proxy":"","authType":"","x":1443,"y":756,"wires":[["76ef22a1.6b00b4"]]},{"id":"2f9090c5.5e2a68","type":"function","z":"4e941abb.909174","name":"application","func":"msg.headers = {};\nmsg.headers['Content-Type'] = 'application/x-www-form-urlencoded';\nmsg.headers['APIm-Debug'] = 'true';\nmsg.payload = {}\nvar globalContext = global;\nmsg.payload.username = globalContext.get(\"username\");\nmsg.payload.password = globalContext.get(\"password\");\nmsg.payload.client_id = globalContext.get(\"client_id\");\nmsg.payload.client_secret = globalContext.get(\"client_secret\");\nmsg.payload.grant_type='client_credentials';\nmsg.payload.scope=\"appscope\";\nmsg.url=globalContext.get(\"oauth_authorize_url\");\nreturn msg;","outputs":1,"noerr":0,"x":1133,"y":616,"wires":[["fb781f6c.7a1b4","3bf986cc.28577a","712390ca.d89e48","2cb51103.9eb686"]]},{"id":"da268265.8566f8","type":"http in","z":"4e941abb.909174","name":"","url":"appredirect","method":"get","upload":false,"swaggerDoc":"","x":120,"y":1096,"wires":[["70ee69c.99bb618"]]},{"id":"10212a69.94f496","type":"http response","z":"4e941abb.909174","name":"","statusCode":"","headers":{},"x":1270,"y":1156,"wires":[]},{"id":"636e50ed.09bac","type":"http in","z":"4e941abb.909174","name":"Authentication","url":"authenticate","method":"get","upload":false,"swaggerDoc":"","x":90,"y":200,"wires":[["dc33418d.a07b5"]]},{"id":"dc33418d.a07b5","type":"http response","z":"4e941abb.909174","name":"","statusCode":"200","headers":{},"x":440,"y":200,"wires":[]},{"id":"cee68243.a50628","type":"function","z":"4e941abb.909174","name":"Confidential","func":"msg.payload = {};\nmsg.payload = msg.scheme;\nreturn msg;","outputs":1,"noerr":0,"x":713,"y":656,"wires":[["2bce53f5.551e1c"]]},{"id":"2bce53f5.551e1c","type":"switch","z":"4e941abb.909174","name":"","property":"scheme","propertyType":"msg","rules":[{"t":"eq","v":"application","vt":"str"},{"t":"eq","v":"password","vt":"str"},{"t":"eq","v":"accesscode","vt":"str"}],"checkall":"true","repair":false,"outputs":3,"x":873,"y":656,"wires":[["2f9090c5.5e2a68"],["40144760.fe6748"],["1903acee.e4951b"]]},{"id":"40144760.fe6748","type":"function","z":"4e941abb.909174","name":"password","func":"msg.headers = {};\nmsg.headers['Content-Type'] = 'application/x-www-form-urlencoded';\nmsg.headers['APIm-Debug'] = 'true';\nvar globalContext = global;\nmsg.payload={};\nmsg.payload.username = globalContext.get(\"username\");\nmsg.payload.password = globalContext.get(\"password\");\nmsg.payload.client_id = globalContext.get(\"client_id\");\nmsg.payload.client_secret = globalContext.get(\"client_secret\");\nmsg.payload.grant_type='password';\nmsg.payload.scope=\"appscope\";\nmsg.url=globalContext.get(\"oauth_token_url\");\nreturn msg;","outputs":1,"noerr":0,"x":1123,"y":656,"wires":[["fb781f6c.7a1b4","3bf986cc.28577a","2cb51103.9eb686","712390ca.d89e48"]]},{"id":"1903acee.e4951b","type":"function","z":"4e941abb.909174","name":"accesscode","func":"var globalContext = global;\nmsg.payload={};\nmsg.payload.oauth_authorize_url = globalContext.get(\"oauth_authorize_url\");\nmsg.payload.redirect_url = globalContext.get(\"redirect_url\");\nmsg.payload.client_id = globalContext.get(\"client_id\");\nreturn msg;","outputs":1,"noerr":0,"x":1130,"y":700,"wires":[["57a8dd09.431bac"]]},{"id":"95e30e6.ec0f0f","type":"function","z":"4e941abb.909174","name":"implicit","func":"var globalContext = global;\nmsg.payload={};\nmsg.payload.oauth_authorize_url = globalContext.get(\"oauth_authorize_url\");\nmsg.payload.redirect_url = globalContext.get(\"redirect_url\");\nmsg.payload.client_id = globalContext.get(\"client_id\");\nreturn msg;","outputs":1,"noerr":0,"x":1103,"y":756,"wires":[["b2bb85f8.faa8c8"]]},{"id":"7e62230f.c4a41c","type":"function","z":"4e941abb.909174","name":"Public","func":"msg.payload = {};\nmsg.payload = msg.scheme;\nreturn msg;","outputs":1,"noerr":0,"x":713,"y":776,"wires":[["567fd4f.65da5ac"]]},{"id":"567fd4f.65da5ac","type":"switch","z":"4e941abb.909174","name":"","property":"scheme","propertyType":"msg","rules":[{"t":"eq","v":"implicit","vt":"str"},{"t":"eq","v":"password","vt":"str"},{"t":"eq","v":"accesscode","vt":"str"}],"checkall":"true","repair":false,"outputs":3,"x":873,"y":776,"wires":[["95e30e6.ec0f0f"],["10d96c8a.81478b"],["66555f3b.6b10e8"]]},{"id":"10d96c8a.81478b","type":"function","z":"4e941abb.909174","name":"password","func":"msg.headers = {};\nmsg.headers['Content-Type'] = 'application/x-www-form-urlencoded';\nmsg.headers['APIm-Debug'] = 'true';\nvar globalContext = global;\nmsg.payload = {};\nmsg.payload.username = globalContext.get(\"username\");\nmsg.payload.password = globalContext.get(\"password\");\nmsg.payload.redirect_url = globalContext.get(\"redirect_url\");\nmsg.payload.client_id = globalContext.get(\"client_id\");\nmsg.payload.grant_type='password';\nmsg.payload.scope=\"appscope\";\nmsg.url={};\nmsg.url=globalContext.get(\"oauth_token_url\");\nreturn msg;\n","outputs":1,"noerr":0,"x":1103,"y":796,"wires":[["fb781f6c.7a1b4","3bf986cc.28577a","712390ca.d89e48","2cb51103.9eb686"]]},{"id":"66555f3b.6b10e8","type":"function","z":"4e941abb.909174","name":"accesscode","func":"var globalContext = global;\nmsg.payload={};\nmsg.payload.oauth_authorize_url = globalContext.get(\"oauth_authorize_url\");\nmsg.payload.redirect_url = globalContext.get(\"redirect_url\");\nmsg.payload.client_id = globalContext.get(\"client_id\");\nreturn msg;","outputs":1,"noerr":0,"x":1113,"y":836,"wires":[["d1acc067.62ace8"]]},{"id":"8ae3702e.3fb0e","type":"switch","z":"4e941abb.909174","name":"","property":"impl","propertyType":"msg","rules":[{"t":"eq","v":"confidential","vt":"str"},{"t":"eq","v":"public","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":553,"y":696,"wires":[["cee68243.a50628"],["7e62230f.c4a41c"]]},{"id":"c7dba8af.4133b","type":"function","z":"4e941abb.909174","name":"function","func":"msg.impl = {};\nmsg.impl = msg.payload.impl;\nmsg.scheme = {};\nmsg.scheme = msg.payload.scheme;\nvar globalContext = global;\nglobalContext.set(\"impl\",msg.impl);\nreturn msg;","outputs":1,"noerr":0,"x":423,"y":696,"wires":[["8ae3702e.3fb0e"]]},{"id":"599dbfb9.46de3","type":"http in","z":"4e941abb.909174","name":"getAccessToken","url":"getAccessToken","method":"post","upload":false,"swaggerDoc":"","x":100,"y":700,"wires":[["ad9cf003.11e128"]]},{"id":"e6215b6c.14517","type":"http response","z":"4e941abb.909174","name":"","statusCode":"","headers":{},"x":2050,"y":956,"wires":[]},{"id":"6e83118b.c5ab1","type":"http in","z":"4e941abb.909174","name":"","url":"logindemo","method":"get","upload":false,"swaggerDoc":"","x":100,"y":399,"wires":[["f02725af.a94c4"]]},{"id":"30855231.df8076","type":"template","z":"4e941abb.909174","name":"","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"\n\n\n\n\nOAuth Demo | Login\n\n\n\n\n\n\n\n\n\n\t\n\t\t
\n\t\t\tOAuth Demo \n\t\t\t\n\n\t\t\t
\n\t\t\t
\n\t\t
\n\t\n\n\t
\n\t
\n\t\t
\n\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t
Login
\n\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\n\t\t\t\t\t\t\t
Choose OAuth\n\t\t\t\t\t\t\t\tImplementation Mode
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
Choose OAuth Scheme
\n\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t
\n\t\t
\n\t
\n\t\n\t
\n\n\n\n\n","output":"str","x":740,"y":399,"wires":[["fd0cbf63.2aba7"]]},{"id":"fd0cbf63.2aba7","type":"http response","z":"4e941abb.909174","name":"","statusCode":"","headers":{},"x":1030,"y":399,"wires":[]},{"id":"b2bb85f8.faa8c8","type":"template","z":"4e941abb.909174","name":"","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"\n \n \n \n \n \n \n","output":"str","x":1303,"y":796,"wires":[["6b254d14.9a52ac"]]},{"id":"6b254d14.9a52ac","type":"http response","z":"4e941abb.909174","name":"","statusCode":"200","headers":{},"x":1543,"y":856,"wires":[]},{"id":"b64f3952.7c4b08","type":"template","z":"4e941abb.909174","name":"","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"\n \n \n \n Some error occured. Please check the authorize and token URL. \n \n \n","output":"str","x":880,"y":1156,"wires":[["10212a69.94f496"]]},{"id":"d1acc067.62ace8","type":"template","z":"4e941abb.909174","name":"","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"\n \n \n \n \n \n \n","output":"str","x":1323,"y":896,"wires":[["6b254d14.9a52ac"]]},{"id":"7491d4ec.fa3144","type":"switch","z":"4e941abb.909174","name":"","property":"tok","propertyType":"msg","rules":[{"t":"eq","v":"2","vt":"str"},{"t":"eq","v":"1","vt":"str"},{"t":"eq","v":"0","vt":"str"}],"checkall":"true","repair":false,"outputs":3,"x":710,"y":1096,"wires":[["76ef22a1.6b00b4"],["8b73a9eb.c541c"],["b64f3952.7c4b08"]]},{"id":"c6f47ce9.1a43","type":"function","z":"4e941abb.909174","name":"","func":"// token appears after a # in the URL\nmsg.tok = 0;\n\nif (msg.payload.code)\n{\n msg.tok = 1;\n}\nif (msg.payload.access_token)\n{\n msg.tok = 2;\n}\nreturn msg;","outputs":1,"noerr":0,"x":510,"y":1096,"wires":[["7491d4ec.fa3144"]]},{"id":"8b73a9eb.c541c","type":"function","z":"4e941abb.909174","name":"","func":"msg.url=msg.payload.oauth_token_url;\nmsg.headers = {};\nmsg.headers['Content-Type'] = 'application/x-www-form-urlencoded';\nvar globalContext=global;\nmsg.payload.grant_type='authorization_code';\nmsg.url=globalContext.get(\"oauth_token_url\");\nmsg.payload.redirect_uri=globalContext.get(\"redirect_url\");\nmsg.payload.client_id=globalContext.get(\"client_id\");\n// client secret is not sent in public implementation mode\nif (globalContext.get(\"impl\") == \"public\")\n msg.payload.client_secret = null;\nreturn msg;\n","outputs":1,"noerr":0,"x":1090,"y":1096,"wires":[["796c54a4.1769dc","8a9f3e58.7efe2","a5e4dce3.ed45a","bf9b7128.9fb818"]]},{"id":"796c54a4.1769dc","type":"http request","z":"4e941abb.909174","name":"Call API Connect Token URL","method":"POST","ret":"txt","paytoqs":false,"url":"","tls":"","proxy":"","authType":"","x":1380,"y":1096,"wires":[["76ef22a1.6b00b4"]]},{"id":"57a8dd09.431bac","type":"template","z":"4e941abb.909174","name":"","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"\n \n \n \n \n \n \n","output":"str","x":1380,"y":680,"wires":[["30c330ba.f106f8"]]},{"id":"30c330ba.f106f8","type":"http response","z":"4e941abb.909174","name":"","statusCode":"","headers":{},"x":1583,"y":696,"wires":[]},{"id":"76ef22a1.6b00b4","type":"function","z":"4e941abb.909174","name":"function","func":"var jsonstr = msg.payload;\n\nvar jsonobj = {};\nif (typeof(jsonstr)==\"string\")\n jsonobj = JSON.parse(jsonstr);\nelse jsonobj = jsonstr;\nmsg.payload = {};\nmsg.payload = jsonobj;\nvar globalContext = global;\nmsg.payload.node_red_url = globalContext.get(\"node_red_url\");\nmsg.payload.url = msg.payload.node_red_url+\"/apimenu\";\nmsg.payload.domain = msg.payload.node_red_url.substring(8);\nreturn msg;","outputs":1,"noerr":0,"x":1660,"y":956,"wires":[["a3e1c6d6.2f2d7"]]},{"id":"a3e1c6d6.2f2d7","type":"template","z":"4e941abb.909174","name":"","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"\n\n\n \n \n Authentication Successful!\n \n \n \n \n \n \n \n\n\n\n\n
\n
\n
\n
\n
\n
Authentication was successful.
\n
\n Got OAuth token and storing it in a cookie - {{{payload.access_token}}}.\n
\n Redirecting to menu options....\n
\n
\n \n
\n
\n
\n
\n\n
\n\n\n\n","output":"str","x":1840,"y":956,"wires":[["e6215b6c.14517"]]},{"id":"2224d251.bd4426","type":"http in","z":"4e941abb.909174","name":"","url":"apimenu","method":"get","upload":false,"swaggerDoc":"","x":130,"y":1276,"wires":[["1b73ed9c.73fdf2"]]},{"id":"1b73ed9c.73fdf2","type":"template","z":"4e941abb.909174","name":"","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"\n\n\n\n\nAPI Menu\n\n\n\n\n\n\n\n\n\n\t\n\t\t
\n\t\t\tOAuth Demo\n\t\t\t\n\n\t\t\t
\n\t\t\t\t
    \n\t\t\t\t\t
  • Home\n\t\t\t\t\t
  • \n\t\t\t\t\t
  • Logout\n\t\t\t\t\t
  • \n\t\t\t\t
\n\n\t\t\t
\n\t\t
\n\t\n\n\t
\n\t
\n\t\t
\n\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t
API Options
\n\t\t\t\t\t
\n\t\t\t\t\t\t
\n\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t

The token is read from the secure cookie and is used to invoke the API.

\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t
\n\n\t\t\t\t
\n\t\t\t
\n\t\t
\n\t
\n\n\t
\n\n\t\n\n\n\n\n","output":"str","x":380,"y":1276,"wires":[["9f79f9f8.6c8bf8"]]},{"id":"9f79f9f8.6c8bf8","type":"http response","z":"4e941abb.909174","name":"","statusCode":"","headers":{},"x":610,"y":1276,"wires":[]},{"id":"73f343ae.d69bdc","type":"http in","z":"4e941abb.909174","name":"","url":"callapi","method":"post","upload":false,"swaggerDoc":"","x":130,"y":1416,"wires":[["55694421.077e84"]]},{"id":"ee50437f.4805d","type":"function","z":"4e941abb.909174","name":"","func":"msg.headers = {};\nmsg.headers['X-IBM-Client-Id']= msg.payload.client_id;\nmsg.headers['Authorization']= 'Bearer '+msg.payload.inputaccesstoken;\nmsg.url = msg.payload.api_url;\nmsg.payload={};\nreturn msg;","outputs":1,"noerr":0,"x":570,"y":1416,"wires":[["478e860d.ee44c"]]},{"id":"478e860d.ee44c","type":"http request","z":"4e941abb.909174","name":"","method":"GET","ret":"txt","paytoqs":false,"url":"","tls":"","proxy":"","authType":"basic","x":830,"y":1416,"wires":[["1a1214be.718243"]]},{"id":"1a1214be.718243","type":"http response","z":"4e941abb.909174","name":"","statusCode":"","headers":{},"x":1090,"y":1416,"wires":[]},{"id":"d724d7a9.c0f528","type":"http in","z":"4e941abb.909174","name":"","url":"configuredemo","method":"get","upload":false,"swaggerDoc":"","x":110,"y":300,"wires":[["1fb7dd01.173733"]]},{"id":"1fb7dd01.173733","type":"template","z":"4e941abb.909174","name":"","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"\n\n\n\n\nOAuth Demo | Configuration\n\n\n\n\n\n\n\n \n\t\t
\n\t\t\tOAuth Demo \n\t\t\t\n\n\t\t\t
\n\t\t\t
\n\t\t
\n\t\n\t
\n\t
\n\t\t
\n\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t
OAuth2 Configuration
\n\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\n\n\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t
\n\n\t\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t
\n\t\t
\n\t
\n\t
\n\n\n\n\n","output":"str","x":380,"y":300,"wires":[["30c9c193.b6a7de"]]},{"id":"30c9c193.b6a7de","type":"http response","z":"4e941abb.909174","name":"","statusCode":"","headers":{},"x":650,"y":300,"wires":[]},{"id":"90a3b2e9.0fe7a","type":"http in","z":"4e941abb.909174","name":"Apply Configuration","url":"/configureapply","method":"post","upload":false,"swaggerDoc":"","x":910,"y":300,"wires":[["9b0b151b.133378"]]},{"id":"9b0b151b.133378","type":"function","z":"4e941abb.909174","name":"SetGlobal","func":"var node_red_url = msg.payload.node_red_base_url;\nvar oauth_authorize_url = msg.payload.authorize_url;\nvar oauth_token_url = msg.payload.token_url;\nvar redirect_url = msg.payload.redirect_url;\nvar client_id = msg.payload.client_id;\nvar client_secret = msg.payload.client_secret;\nvar api_url = msg.payload.api_url;\nvar globalContext = global;\nglobalContext.set(\"node_red_url\",node_red_url);\nglobalContext.set(\"api_url\",api_url);\nglobalContext.set(\"oauth_authorize_url\",oauth_authorize_url);\nglobalContext.set(\"oauth_token_url\", oauth_token_url);\nglobalContext.set(\"redirect_url\", redirect_url);\nglobalContext.set(\"client_id\", client_id);\nglobalContext.set(\"client_secret\", client_secret);\nreturn msg;","outputs":1,"noerr":0,"x":1100,"y":300,"wires":[["961f6aca.3877"]]},{"id":"961f6aca.3877","type":"template","z":"4e941abb.909174","name":"","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"\n \n Applied configuration successfully. Please wait...\n \n \n","output":"str","x":1260,"y":300,"wires":[["a90f58f4.2029e"]]},{"id":"a90f58f4.2029e","type":"http response","z":"4e941abb.909174","name":"","statusCode":"200","headers":{},"x":1440,"y":300,"wires":[]},{"id":"f02725af.a94c4","type":"function","z":"4e941abb.909174","name":"GetGlobal","func":"msg.payload={}\nvar globalContext = global;\nmsg.payload.node_red_url = globalContext.get(\"node_red_url\");\nreturn msg;","outputs":1,"noerr":0,"x":400,"y":400,"wires":[["30855231.df8076"]]},{"id":"ad9cf003.11e128","type":"function","z":"4e941abb.909174","name":"GetGlobal","func":"var globalContext = global;\nglobalContext.set(\"username\",msg.payload.username);\nglobalContext.set(\"password\",msg.payload.password);\nreturn msg;","outputs":1,"noerr":0,"x":260,"y":700,"wires":[["c7dba8af.4133b"]]},{"id":"70ee69c.99bb618","type":"function","z":"4e941abb.909174","name":"GetGlobal","func":"var globalContext = global;\nglobalContext.set(\"username\",msg.payload.username);\nglobalContext.set(\"password\",msg.payload.password);\nmsg.payload.redirect_uri = globalContext.get(\"redirect_url\");\nmsg.payload.client_id = globalContext.get(\"client_id\");\nmsg.payload.client_secret = globalContext.get(\"client_secret\");\nreturn msg;","outputs":1,"noerr":0,"x":320,"y":1096,"wires":[["c6f47ce9.1a43"]]},{"id":"55694421.077e84","type":"function","z":"4e941abb.909174","name":"GetGlobal","func":"var globalContext = global;\nmsg.payload.api_url = globalContext.get(\"api_url\");\nmsg.payload.client_id = globalContext.get(\"client_id\");\nreturn msg;","outputs":1,"noerr":0,"x":340,"y":1416,"wires":[["ee50437f.4805d"]]},{"id":"3bf986cc.28577a","type":"debug","z":"4e941abb.909174","name":"payload","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":1380,"y":600,"wires":[]},{"id":"b8a9fe1c.076b2","type":"comment","z":"4e941abb.909174","name":"Application API","info":"","x":100,"y":20,"wires":[]},{"id":"f463c12a.e6de48","type":"comment","z":"4e941abb.909174","name":"Dummy Authentication Service (accepts all usernames and passwords)","info":"","x":270,"y":140,"wires":[]},{"id":"456229eb.b88c78","type":"comment","z":"4e941abb.909174","name":"Client application login","info":"","x":120,"y":359,"wires":[]},{"id":"bc6d88f0.4dc1","type":"comment","z":"4e941abb.909174","name":"Application configuration with API Connect Authorize URL, Token URL, Client ID, Client Secret etc.","info":"","x":360,"y":260,"wires":[]},{"id":"8100f354.bd204","type":"comment","z":"4e941abb.909174","name":"Flow to get token from API connect based on the OAuth implementation mode and scheme","info":"","x":360,"y":540,"wires":[]},{"id":"39e329a4.4aa4ae","type":"comment","z":"4e941abb.909174","name":"OAuth Redirect URL - configured on API Connect","info":"","x":220,"y":1020,"wires":[]},{"id":"81ca51e1.38e098","type":"comment","z":"4e941abb.909174","name":"Application API Menu (apis that can be invoked with the token)","info":"","x":290,"y":1240,"wires":[]},{"id":"5949bc65.80a52c","type":"comment","z":"4e941abb.909174","name":"Call API with Token flow","info":"","x":160,"y":1360,"wires":[]},{"id":"bb298df0.7b3af8","type":"comment","z":"4e941abb.909174","name":"Store configuration in a global variable","info":"","x":970,"y":260,"wires":[]},{"id":"fb4ac7f5.1beb58","type":"comment","z":"4e941abb.909174","name":"The below flow returns the CSS style sheet","info":"","x":220,"y":1500,"wires":[]},{"id":"380c6eef.664e12","type":"http in","z":"4e941abb.909174","name":"","url":"style.css","method":"get","upload":false,"swaggerDoc":"","x":130,"y":1560,"wires":[["3faae734.ccd148"]]},{"id":"3faae734.ccd148","type":"template","z":"4e941abb.909174","name":"Styles","field":"payload","fieldType":"msg","format":"css","syntax":"plain","template":"/* Starter CSS for Flyout Menu */\n \nbody, html {\n height: 100%;\n}\n.bg {\n\n /* Full height */\n height: 100%;\n\n /* Center and scale the image nicely */\n background-position: center;\n background-repeat: no-repeat;\n background-size: cover;\n}\n\n.navbar-laravel\n{\n box-shadow: 0 2px 4px rgba(0,0,0,.8);\n}\n\n.navbar-brand , .nav-link, .my-form, .login-form\n{\n font-family: Raleway, sans-serif;\n}\n\n.my-form\n{\n padding-top: 1.5rem;\n padding-bottom: 1.5rem;\n}\n.special-card {\n opacity: .7;\n}\n\n.transp {\n box-shadow: 0 2px 4px rgba(0,0,0,.04);\n}\n\n.my-form .row\n{\n margin-left: 0;\n margin-right: 0;\n}\n\n.login-form\n{\n padding-top: 12rem;\n padding-bottom: 1.5rem;\n}\n\n.login-form .row\n{\n margin-left: 0;\n margin-right: 0;\n}\n\n#cssmenu {\n padding: 0;\n margin: 0;\n border: 0;\n}\n#cssmenu ul,\nli {\n list-style: none;\n margin: 0;\n padding: 0;\n}\n#cssmenu ul {\n position: relative;\n z-index: 597;\n float: left;\n}\n#cssmenu ul li {\n float: left;\n min-height: 1px;\n line-height: 1em;\n vertical-align: middle;\n}\n#cssmenu ul li.hover,\n#cssmenu ul li:hover {\n position: relative;\n z-index: 599;\n cursor: default;\n}\n#cssmenu ul ul {\n visibility: hidden;\n position: absolute;\n top: 100%;\n left: 0;\n z-index: 598;\n width: 100%;\n}\n#cssmenu ul ul li {\n float: none;\n}\n#cssmenu ul li:hover > ul {\n visibility: visible;\n}\n#cssmenu ul ul {\n top: 0;\n left: 100%;\n}\n#cssmenu ul li {\n float: none;\n}\n/* Custom Stuff */\n#cssmenu span,\n#cssmenu a {\n display: inline-block;\n font-family: Arial, Helvetica, sans-serif;\n font-size: 12px;\n text-decoration: none;\n}\n#cssmenu {\n -moz-border-radius: 5px;\n -webkit-border-radius: 5px;\n border-radius: 5px;\n -moz-background-clip: padding;\n -webkit-background-clip: padding-box;\n background-clip: padding-box;\n -moz-box-shadow: 0 0 2px 1px rgba(0, 0, 0, 0.15);\n -webkit-box-shadow: 0 0 2px 1px rgba(0, 0, 0, 0.15);\n box-shadow: 0 0 2px 1px rgba(0, 0, 0, 0.15);\n font-weight: 600;\n width: 200px;\n}\n#cssmenu:after,\n#cssmenu ul:after {\n content: '';\n display: block;\n clear: both;\n}\n#cssmenu > ul > li:first-child {\n -moz-border-radius: 5px 5px 0 0;\n -webkit-border-radius: 5px 5px 0 0;\n border-radius: 5px 5px 0 0;\n -moz-background-clip: padding;\n -webkit-background-clip: padding-box;\n background-clip: padding-box;\n}\n#cssmenu > ul > li:last-child {\n -moz-border-radius: 0 0 5px 5px;\n -webkit-border-radius: 0 0 5px 5px;\n border-radius: 0 0 5px 5px;\n -moz-background-clip: padding;\n -webkit-background-clip: padding-box;\n background-clip: padding-box;\n}\n#cssmenu > ul > li ul ul li:first-child {\n -moz-border-radius: 0 5px 0 0;\n -webkit-border-radius: 0 5px 0 0;\n border-radius: 0 5px 0 0;\n -moz-background-clip: padding;\n -webkit-background-clip: padding-box;\n background-clip: padding-box;\n}\n#cssmenu > ul > li ul ul li:last-child {\n -moz-border-radius: 0 0 5px 0;\n -webkit-border-radius: 0 0 5px 0;\n border-radius: 0 0 5px 0;\n -moz-background-clip: padding;\n -webkit-background-clip: padding-box;\n background-clip: padding-box;\n}\n#cssmenu ul,\n#cssmenu li {\n width: 100%;\n}\n#cssmenu li {\n background: #c0bebf url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAA0CAMAAAB8fKKlAAAAmVBMVEXy7ery7ery7ery7ery7ery7ery7ery7ery7ery7ery7erx7ery7ery7ery7ery7ery7ery7ery7ery7ery7ery7ery7ery7ery7ery7ery7ery7ery7ery7ery7ery7ery7ery7ery7ery7ery7ery7ery7ery7ery7ery7ery7ery7ery7ery7ery7ery7ery7ery7ery7eoO3g4TAAAAMnRSTlP8+fbz7+vn497Z1M/KxL+5s66oopuVj4mDfHZwamRdV1FMRkA7NTArJiEcGBQQDAkGA02z+X0AAABLSURBVHheDcGDEQMBAACwvFnbtrv/cO3F949AKBJLpDK5QqlSa2hqaevo6ukbGBoZm5iamVtYWlnb2NrZOzg6Obu4url7eHp5+/wAxikFLnlTZcYAAAAASUVORK5CYII=) repeat-x;\n background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #f2edea), color-stop(1, #c0bebf));\n background-image: -webkit-linear-gradient(top, #f2edea, #c0bebf);\n background-image: -moz-linear-gradient(top, #f2edea, #c0bebf);\n background-image: -ms-linear-gradient(top, #f2edea, #c0bebf);\n background-image: -o-linear-gradient(top, #f2edea, #c0bebf);\n background-image: linear-gradient(#f2edea, #c0bebf);\n}\n#cssmenu li:hover,\n#cssmenu li.active {\n background: #606a76 url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAA0CAMAAAB8fKKlAAAAmVBMVEVKVmJKVmJKVmJKVmJKVmJKVmJKVmJKVmJKVmJKVmJKVmJKVmJKVmJKVmJKVmJKVmJKVmJKVmJKVmJKVmJKVmJKVmJKVmJKVmJKVmJKVmJKVmJKVmJKVmJKVmJKVmJKVmJKVmJKVmJKVmJKVmJKVmJKVmJKVmJKVmJKVmJKVmJKVmJKVmJKVmJKVmJKVmJKVmJKVmL///9KVmL3Z0MtAAAAMnRSTlP8+fby7+vm4t3Y087Iw723sauln5mTjIaAeXNsZmBaVE5IQjw3MSwnIh0ZFBANCQYDAAm6nKYAAABLSURBVHheDcGDEQMBAACwvFnbtrv/cO3F949AKBJLpDK5QqlSa2hqaevo6ukbGBoZm5iamVtYWlnb2NrZOzg6Obu4url7eHp5+/wAxikFLnlTZcYAAAAASUVORK5CYII=) repeat-x;\n -moz-box-shadow: inset 0 -2px 3px rgba(0, 0, 0, 0.15);\n -webkit-box-shadow: inset 0 -2px 3px rgba(0, 0, 0, 0.15);\n box-shadow: inset 0 -2px 3px rgba(0, 0, 0, 0.15);\n background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #4a5662), color-stop(1, #606a76));\n background-image: -webkit-linear-gradient(top, #4a5662, #606a76);\n background-image: -moz-linear-gradient(top, #4a5662, #606a76);\n background-image: -ms-linear-gradient(top, #4a5662, #606a76);\n background-image: -o-linear-gradient(top, #4a5662, #606a76);\n background-image: linear-gradient(#4a5662, #606a76);\n}\n#cssmenu li:hover > a,\n#cssmenu li.active > a {\n color: #FFF;\n}\n#cssmenu a {\n color: #666666;\n line-height: 160%;\n padding: 16px 8px 16px 28px;\n width: 164px;\n}\n#cssmenu ul ul {\n -moz-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);\n -webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);\n box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);\n width: 200px;\n}\n#cssmenu ul ul li {\n background: #606a76;\n border-bottom: 1px solid #59636F;\n -moz-box-shadow: inset 0 1px 0 #66707c;\n -webkit-box-shadow: inset 0 1px 0 #66707c;\n box-shadow: inset 0 1px 0 #66707c;\n}\n#cssmenu ul ul li:hover {\n background: #4a5662;\n}\n#cssmenu ul ul li a {\n color: #FFF;\n}\n#cssmenu ul ul a,\n#cssmenu ul ul a span {\n font-size: 12px;\n}\n\nbody{\n margin: 0;\n font-size: .9rem;\n font-weight: 400;\n line-height: 1.6;\n color: #212529;\n text-align: left;\n background-color: #f5f8fa;\n}","output":"str","x":350,"y":1560,"wires":[["10882a6c.5647fe"]]},{"id":"10882a6c.5647fe","type":"function","z":"4e941abb.909174","name":"","func":"msg.headers = {};\nmsg.headers[\"Content-Type\"]=\"text/css\";\nmsg.headers[\"Accept\"]=\"text/css\";\nreturn msg;","outputs":1,"noerr":0,"x":590,"y":1560,"wires":[["5abb0e49.8b68e8"]]},{"id":"5abb0e49.8b68e8","type":"http response","z":"4e941abb.909174","name":"","statusCode":"","headers":{},"x":810,"y":1560,"wires":[]},{"id":"712390ca.d89e48","type":"debug","z":"4e941abb.909174","name":"headers","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"headers","targetType":"msg","x":1390,"y":560,"wires":[]},{"id":"2cb51103.9eb686","type":"debug","z":"4e941abb.909174","name":"URL","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"url","targetType":"msg","x":1370,"y":520,"wires":[]},{"id":"8a9f3e58.7efe2","type":"debug","z":"4e941abb.909174","name":"headers","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"headers","targetType":"msg","x":1440,"y":1000,"wires":[]},{"id":"a5e4dce3.ed45a","type":"debug","z":"4e941abb.909174","name":"payload","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":1420,"y":1040,"wires":[]},{"id":"bf9b7128.9fb818","type":"debug","z":"4e941abb.909174","name":"URL","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"url","targetType":"msg","x":1430,"y":940,"wires":[]}]