This can be resolved for localhost by changing the platform in App registration. Instead of using Single Page Application in Platform use Mobile or Desktop Application platform. This resolves issue for Localhost. But if you wish to run Single Page Application on Server then keep the Single Page Application Platform configured as well.