I have created a HTML page which contains a feature layer that is published in the ArcGIS Online. The feature layer is shared with organization. When I run the page it is asking for the username and password, and whenever I enter the credentials it shows the username or password you entered is incorrect, but I know my username and password is absolutely correct.
When I checked in network, in generateToken file it gives error like: message: "Unable to generate token." details: ["'referer' must be specified."]
And when I tried the same code in ArcGIS Online sandbox it worked fine.