How to use access tokens for offchain services & verify them
Last updated
Last updated
Much like how we described in "How to login with Emergence", you can use the access token as a method to verify the ownership of a wallet. In the future, we'll explain how you can request the player to sign your own access token, but for now, this tutorial will make use of the access token the player signs whenever they log into Emergence.
To get the current access token, you can follow use the method GetCachedAccessToken (Unreal / Unity). You can check one already exists with HasAccessToken (Unreal / Unity).
You can then make use of a HTTP plugin for Unreal (or write your own) to communicate with your offchain service of choice. Emergence also implements various HTTP functions for communicating with our own offchain services, but public use of these are currently not supported. The access token contains the player's wallet address, so theoretically you can extract the wallet address from the access token, so you don't need to send both.