Table of Contents
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 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 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 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 Iauth message.
Authentication failed
If above authentication attempts failed, server did not like the response sent back in the Iauth message, it will send back an authentication error message:
S → C {type: 'unauthorised', error:…}
- error - authorisation failure error number:
To try again you must start a new authentication process by sending a new Iam message.