0

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
Zheng Xie
  • 415
  • 3
  • 13
  • 1
    Can you please share your Node.js code or what you changed/removed so we can better investigate? – Joshua Alger Feb 04 '16 at 14:27
  • I have reverted the server.js to the original. still the same error. What does this exception mean? Can you tell what is wrong? – Zheng Xie Feb 04 '16 at 16:18
  • was the application ever working? Can you get it back to a working state? Have you configured the necessary components for custom auth? Can you please check your configuration both client side and server side. You can follow the instructions here: https://www.ng.bluemix.net/docs/services/mobileaccess/custom-auth-identity-provider.html – Joshua Alger Feb 04 '16 at 16:25
  • I think I know why. I have configured custom auth and I have a customAuth.js in the node.js app. I initially used "cf push" to push the app where the source code is on my local hard drive. Then when I edited the server.js,I did was in Bluemix DevOps "Edit Code" for the app. I now see that my customAuth.js is not in the file tree. So looks like the DevOps only has the starter kit, doesn't have the deployed app that is deployed by cf. – Zheng Xie Feb 05 '16 at 12:30
  • Hi Josh, if I use the sample "bms-samples-hellotodo-advanced-master" as my base, because I need to extend its end points. how do I add the customauth related js files from the Bluelist example to it? – Zheng Xie Feb 05 '16 at 12:56
  • You need to pull down the entire node.js package, then edit/add code and/or files to it as shown in the linked instructions above. After you have everything added and configured do a cf push to push the node app to your bluemix instance. – Joshua Alger Feb 05 '16 at 16:25

1 Answers1

0

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

Zheng Xie
  • 415
  • 3
  • 13