On 05/22/2013 10:12 AM, Kris Borchers wrote:
OK, so I am going to try to spell out the workflow as I see it working in JS. I would appreciate any feedback on whether or not this is crazy/wrong.
- Create Basic or Digest authenticator
- Must include a callback to be fired when a request to auth is received from server
- Create pipe which uses this authenticator
- Attempt read, save or remove on this pipe
- Endpoint returns 401 with header indicating type of auth required
- Need to research that this won't trigger the browser's native Basic/Digest auth handling
- Fire user supplied auth callback passing it a reference to a "login" method that the user will pass the credentials collected in the auth callback
- Use "login" method to construct appropriate response to server's 401
- This is the fun part :-P
In the Android version, login is called by the developer, not by the framework. This "primes" the authenticator which then provides whatever tokens/headers/parameters/etc that the pipe will need to authenticate the request.
same with iOS with an HttpBasic/Digest authentication module. Upon 'login', credentials are 'cached' using a build-in system provided object (no http request). When a request is made which requires authentication, the system checks first to see if credentials exists in its store(which we cached earlier with 'login') and if found it authenticates the session. Similar, when 'logout' is called, we remove the cached credentials from the system.
for this particular context, the authentication module mechanism we have, fitted nicely in filling the credential information to the system store, which uses them for authentication (and hopefully enough
Thanks
Christos
_______________________________________________
aerogear-dev mailing list
aerogear-dev@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/aerogear-dev