REST Authentication
Ladder diagram
Client wrtc_kit RTCgate WEB server | | | 1 |---fetchRESTtoken()--->| | 2 | |-------------------------HTTP GET----->| 3 | |<-------------------------rtoken-------| | | | 4 |--changeCredentials()->| | 5 | |-------Iam-------->| | 6 | |<-----welcome------| | 7 |<----onLoggedIn()------| | |
Usually the REST authentication token is included in the Iam message sent to the RTCgate server. In that case the welcome message comes immediately.
If the REST authentication token is not included in the Iam message then an unauthorised/Iauth message exchange will occur:
Client wrtc_kit RTCgate WEB server | | | 1 |---fetchRESTtoken()--->| | 2 | |-------------------------HTTP GET----->| 3 | |<-------------------------rtoken-------| | | | 4 |--changeCredentials()->| | 5 | |-------Iam-------->| | 6 | |<--unauthorised----| | 7 |<---onAuthenticate()---| | | 8 | |-------Iauth------>| | 9 | |<-----welcome------| | 10 |<----onLoggedIn()------| | |
7: wrtc_kit raises a wrtc.onAuthenticate() event but usually no such event handler is defined by user. Then wrtc_kit calls line.authenticate() by itself.