====== unauthorised ====== The unauthorised message is both used to request authentication and to inform that authentication has failed: **S → C {type: 'unauthorised', auth_type: ...}** Authentication request, server requests client to authenticate itself using digest or REST token authentication, see below. **S → C {type: 'unauthorised', error: ...}** Authentication failed, you are not allowed to use the service, see below. If authentication succeeds a [[ixnx:wrtc:rtcgate:welcome|welcome]] message is sent by server. ===== Digest authentication ===== A digest authentication challenge contains: \\ S → C {type: 'unauthorised', auth_type:'digest', algorithm:'MD5', realm:..., nonce:..., uri:..., qop:..., cnonce:..., nc:..., response:...} * auth_type - digest * algorithm - only MD5 supported * realm, nonce, uri, qop, cnonce, nc, response - as defined by digest authentication standard Client shall send its digest authentication answer to server in an [[ixnx:wrtc:rtcgate:iauth|Iauth]] message. ==== Example ==== S → C {type: 'unauthorised', auth_type:'digest', realm:'sipdomain.com', nonce:'ogMJAOu3TUeSzZ6iMfMn4bxn1dU=', uri:'sip:sipdomain.com', qop:'auth', cnonce:'5a900455', nc:'00000001', response:'c1c88feaecc26bf2f05bb51334213dd8', algorithm:'MD5'} ===== REST token authentication ===== A REST token authentication challenge contains: \\ S → C {type: 'unauthorised', auth_type:'rtoken'} If client has indicated in its [[ixnx:wrtc:rtcgate:iam|Iam]] message that it has a REST token server may request that token using this REST token authentication challenge message. Client shall then send its REST token to server in an [[ixnx:wrtc:rtcgate:iauth|Iauth]] message. ===== Authentication failed ===== If above authentication attempts failed, server did not like the response sent back in the [[ixnx:wrtc:rtcgate:iauth|Iauth]] message, it will send back an authentication error message:\\ S → C {type: 'unauthorised', error:...} * error - authorisation failure error number: * 401 - rejected, [[ixnx:wrtc:rtcgate:iauth|supplied]] digest answer or REST token was not accepted by server * 423 - expired, [[ixnx:wrtc:rtcgate:iauth|supplied]] REST token was too old, client need to fetch and supply a new one To try again you must start a new authentication process by sending a new [[ixnx:wrtc:rtcgate:iam|Iam]] message. ====== See Also ====== [[ixnx:wrtc:rtcgate:iauth|Iauth]] [[ixnx:wrtc:rtcgate:welcome|welcome]]