javascriptsencha-touch-2azure-mobile-servicesjwtsencha-touch-2.3

Sencha touch azure mobile service custom login how to set user?


So I can get all necessary data from my server when username and password are provided (zumoJwt token, user id and auth identity), but I still cannot get the user id property from the user object at the server side. I'm trying to set the user as follows:

Ext.azure.Authentication.setCurrentUser({id: res.id, token: res.token});

Where res.id is the user id and res.token is the server generated zumoJwt token.

So my question here is as follows: How can I set these values properly to proper place in order to authenticate to the server with my custom authentication service?


Solution

  • The Sencha Touch Extensions for Windows Azure are built to connect via oAuth to the Azure Mobile Services, and therefore only support the oAuth providers available from Azure (Facebook, Twitter, Google, Microsoft).

    Calling Ext.azure.Authentication.setCurrentUser() literally does nothing except store those values locally in HTML5 localstorage. Those values might get added to HTTP request headers later (if useHeaderAuthentication is set to true)... but these Azure extensions for Sencha Touch aren't going to allow you to use a custom oAuth provider.

    Does Azure Mobile Services even allow you to use a custom authentication service? I know the Active Directory integration is new, but the Sencha Touch extensions don't support that yet.