authentication - Best worklight practices to logout and to remember a session -
i want know best practices, when using worklight:
- to logout
- to maintain user logged in, after application relaunch.
- to login user directly after account creation
i using worklight 6 authentication, custom login module, hybrid app (html5)
if there sample doing these feature, great, otherwise, code snippets , advices should me.
thanks
can't these 'best practices', in these situations:
to logout
don't have here. clear , user use access resources on server, including cookies. know, login modules come logout function call can perform these operations.
to maintain user logged in, after application relaunch
after first login, use local storage mechanism, such jsonstore, in order save credentials. jsonstore can encrypt data saved locally well. when user starts app, instead of prompting login credentials, check local storage see if credentials exist , send them server log in.
to login user directly after account creation
i'd use similar approach above. when user sends account information server, save local storage. if account creation successful, server can send success response client can automatically send credentials server log them in. if server sends failure response, credentials should deleted local store , user prompted try register again.
Comments
Post a Comment