Table of Contents
adv.getTokenVal()
wrtc.adv.getTokenVal() is used to extract values from the unencrypted part of a REST authentication token.
A REST authentication token always contains an encrypted payload that only IXNX server can decrypt, but it may also contain unencrypted data visible for everyone.
Arguments
wrtc.adv.getTokenVal(key, token)
- key - string containing the requested token field's key
- token - (optional) string containing the token to examine. If missing last token provided by wrtc.setRESTtoken() will be used.
There are many different token fields a REST authentication token may contain:
- t=token - the token hashsum that validates the token
- i=initial vector - hashsum nonce
- n=name - login name that was used when acquiring the token
- u=name - username to set wrtc.myname to
- a=name - SIP authentication name
- P=password - SIP authentication password (preferably included into c field below)
- s=start - valid from time of token
- e=expire - expiration time of token
- p=path - token refresh path to set wrtc.rpath to
- telnr=number - telephone number (alternative SIP addr.)
- dname=name - SIP display name
- T=number(s) - template numbers allowed to be used. Several numbers can be specified, separated by spaces.
- c=data - encrypted data only readable by IXNX unit. May contain any of the above fields.
Other token fields may be added in the future. All fields except t= are optional.
You may add your own token fields. The client can read those fields using wrtc.adv.getTokenVal()
Returns
The requested token field's value.
Example
If REST authentication token contained:
e=1427887637\nu=martinga\nn=mgrest\npp=abc\nt=a3IveZSExvjXQUPkQuyaJg\ni=IvZM_WBUpDzDv6Ay\nc=Hm_39-g9
wrtc.adv.getTokenVal("u") will return "martinga"