The other day I was trying to get this demo to work:
But having no success. The steps are very detailed, and I followed them exactly. The userpart of the demo works, that's fine. But the app part won't work. I'm got the error:
The identity of the calling application could not be established. {"odata.error":{"code":"Authorization_IdentityNotFound"}}
Long story short, turns out to be a problem when creating the app registrations in the new Azure portal. So use the old one for this.
Se also my post on stackoverflow: here