none
[Node.js] Get master key from azure mobile apps RRS feed

  • Question

  • Hi I'm using Azure and JWT to create an user login app. The old code was done with Azure mobile services, which has been replaced by the new Azure app services. I'm stuck at migrating the original code to the new Azure mobile apps. My code is listed below:

    jwthelper.hash(item.password, item.salt, function(err, h) {

    item.password = h;                        
                            item.status = 'NewAccount';
                            item.createDate = new Date();
                            item.updateDate = new Date();
                            console.log("entramos");


                            accounts.insert(item).then(function(){

                                console.log("insertado");
                               /*
                               var userId = aud + ":" + item.id;

                               //update our record with the user id                            
                               item.userId = userId;
                               accounts.update(item);

      // We don't want the salt or the password going back to the client
      delete item.password;
      delete item.salt;
                               delete item.status;                              

                               item.token = jwthelper.zumoJwt(aud, userId, request.service.config.masterKey);
                               item.Status = 'User registered';
                               response.send(201, item);*/

                            }).then(function(results){
                                console.log("insertado");
                            });                        

    });   

    Here the request.service.config.masterKey no longer works, as request.service has been replaced by request.azureMobile. However I tried request.service.config.masterKey and still it didn't work. How can I upgrade the code to the new platform?



    Sunday, September 11, 2016 12:33 AM

All replies