I am trying to learn how to access services using OAuth2 with javascript.
I am working on the tutorial on this link Access services with OAuth 2.0 | ArcGIS for Developers. Initially, it allows me to sign in (from the sign in link) and provide my arcgis online credentials. Thereafter, I am getting the error below after I have entered my arcgis online credentials.
I followed the steps of creating, registering and providing a redirect uri for the application. I copied the code and changed the portalURL and appid. So I just advice on why I am getting this error