Search code examples
node.jsibm-cloudibm-mobile-services

Bluemix Authentication Error after modify node.js


My mobile app that uses Mobilefirst Client Access service can not login and on the server side, I see the following error. It was working until I modified the server.js. I added some HTTP GET/PUT/POST end points. The app did start and I can test these end points using browser. But the mobile app then throws error 02-04 14:07:28.247 13660-13700/com.ibm.bluelist E/SplashActivityLoginFail: Failed to login: Response: 02-04 14:07:28.247 13660-13699/com.ibm.bluelist E/mfpsdk.AuthorizationProcessManager: AuthorizationProcessManager.handleAuthorizationFailure in AuthorizationProcessManager.java:426 :: authorization process failed

Server side error:

Error: Cannot POST /apps/272690ba-3a01-4f82-8f79-293688c5b1de/customAuthRealm_1/startAuthorization
at raiseUrlNotFoundError (/home/vcap/app/node_modules/loopback/server/middleware/url-not-found.js:15:17)
at Layer.handle [as handle_request] (/home/vcap/app/node_modules/loopback/node_modules/express/lib/router/layer.js:95:5)
at trim_prefix (/home/vcap/app/node_modules/loopback/node_modules/express/lib/router/index.js:312:13)
at /home/vcap/app/node_modules/loopback/node_modules/express/lib/router/index.js:280:7
at Function.process_params (/home/vcap/app/node_modules/loopback/node_modules/express/lib/router/index.js:330:12)
at next (/home/vcap/app/node_modules/loopback/node_modules/express/lib/router/index.js:271:10)
at serveStatic (/home/vcap/app/node_modules/loopback/node_modules/express/node_modules/serve-static/index.js:74:16)
at Layer.handle [as handle_request] (/home/vcap/app/node_modules/loopback/node_modules/express/lib/router/layer.js:95:5)
at trim_prefix (/home/vcap/app/node_modules/loopback/node_modules/express/lib/router/index.js:312:13)
at /home/vcap/app/node_modules/loopback/node_modules/express/lib/router/index.js:280:7

Solution

  • Node.js app pushed by "cf push" are not pulled when use Bluemix DevOps services. The code in DevOps services are just the start pack. I used cf push and push the custom auth and the cloudant enroll applications from the bluelist sample. then when I edited the server.js and redeploy it in DevOPs services, it wiped out the custome auth, thus the auth error. I have migrated them to the starter pack, which is based on LoopBack framework. And it works now. Jen