Picture description:
- Client app connects to socket.io server
- App requests frame
doThat
withdata
andack
- Server processes request and puts/gets data to/from
REST/DB
server. When all work done, server callsack
witherror
andresult
- App processes result and does other things
We support two authentication methods. First is for fresh launched app, when user not gave credentials. Second is for reconnect because of network troubles or app relaunch.
Fresh authentication process (no token present):
- Connect to socket.io server
- [
auth by credentials
](/socket.io/client-emited/auth/auth by credentials.md) - If success, forget username/password and store token for future use
Warmed up authentication process (token is present):
- Reconnect to socket.io server
- [
auth by token
](/socket.io/client-emited/auth/auth by token.md) - If success, store token for future use
If any of two methods failed, app must request user to provide username
and password
credentials.
On any method of authentication suceed, app should do following data gather (in any order):
- get server config (TODO split to ack request, now just
storage urls
emited) - get self info — [
who am i
](/socket.io/client-emited/auth/who am i.md) - get self public keys (TODO split out from
who am i
)
After that, you should do Wizard checks. If they succeed, do following (in any order):
- get public keys for contacts — [
give me keys
](/socket.io/client-emited/key/give me keys.md) - get contacts — [
give me users
](/socket.io/client-emited/user/give me users.md) - get groups — [
give me groups
](/socket.io/client-emited/group/give me groups.md) - get dialogs — [
give me dialogs
](/socket.io/client-emited/dialog/give me dialogs.md) - get contacts presence - [
give me presence
](/socket.io/client-emited/user/give me presence.md)
At this step app is full of user contacts and data and ready for use.