The issue is that the first call to /api/v1/external/login returns intent, not intent_id along with instances your user belongs to.
I have reproduced the error by sending intent_id instead of intent to /api/v1/issue-token-intent. So just by correcting this, you should be good.