Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Use ItchIO's OAuth to get UserID for Unity3D WebGL Game

A topic by Alan Watton created Jul 04, 2022 Views: 226
Viewing posts 1 to 1

Does anyone know of a way to use ItchIO's OAuth for a Unity3D WebGL game hosted on ItchIO?

I'm am not sure what to try next as the game itself is loaded in an IFrame and unable to read the access_token from the parent pages URI after a user has agreed and been redirected back to the game due to cross-origin issues between the Iframe and parent page.

Error: DOMException: Permission denied to access property "hash" on cross-origin object

    var queryString = window.parent.location.hash.slice(1);//Error Here     
    var params = new URLSearchParams(queryString);     
    var accessToken = params.get("access_token");      
    console.log(accessToken); 

Note: window.location has the games Iframe URI without the access_token

This topic has been auto-archived and can no longer be posted in because there haven't been any posts in a while.