I don't think you're doing anything wrong. You shouldn't need to assign licenses dynamically.
It's either two things in my opinion, you got the network id wrong or the system is not being able to authenticate the user, hence is assigning a session cal. If you have a proxy it's probably because the user has not added the qlikview server to the proxy exceptions.
Here is how QlikView assigns licenses
1. If already a Named user, use this license
2. If already a Document CAL user, use this license, if not
3. Are there any Named User CALs available, allocate a license, if not
4. Are there any Document CALs available, allocate a license, if not
5. Are there any Session CALs available, allow the user to use a session, if not
6. Are there any Usage CALs available, allocate a Usage CAL, if not
7. If there are no CALs available, the user will be prompted to contact the system manager to request a license.
Thanks a lot for your response. its very useful.
The other thing I am observing is, if I assign document CAL's to a user for a document (using QEMC -> user documents), it is picking the document cal for that user. Because of this I haven't checked the proxy settings. But I will ask my network administrator to check this for me.
You think is there any other settings that I need to check?
Thanks in advance for your help.