How to Retrieve Long-Lived JWTs for Guest Accounts and Unreal Engine Implementation

Hey everyone,

I’m working on integrating guest accounts in Unreal Engine using the RPM-SDK with the native avatar creator, and I could really use some help!

Here’s what I’ve got so far:

My API server creates a user on my subdomain, links the userId to a database field, and returns a 15-second token in Unreal.

For the native Unreal avatar creator, I managed to achieve guest login by opening a hidden in-game browser and passing in the short-lived token (https://{your-subdomain}.readyplayer.me/avatar?frameApi&token={token}). Then, I am grabbing the token from LocalStorage with the persist:user field and modified the Unreal plugin to use this token with a new C++ GuestLogin blueprint node (similarly to Anonymous login, that takes this token). But, this isn’t the best solution as it relies on a browser.

Full authorization for guest accounts:

Is there an endpoint that returns a “long-lived” JWT from the 15-second guest login token on behalf of the user?

When inspecting local storage in Chrome, I noticed a field called persist:user which holds all my data, including a JWT and Refresh Token etc. Is there an API call (endpoint) I can use to get back these persist:user fields for use in Unreal and on my web API (e.g., to list avatars for the user)? Seems like this is being handled on your servers when I pass the token into the “frameApi&token=” and I am hoping there is a way for me as a developer to do this.

Are there any plans on bringing guest accounts to the Unreal SDK?

Another issue I’m facing:

I’ve followed the Account Linking Guide, but if I’m already logged in and pass a new token for a different user in the same browser session, it doesn’t properly switch to the new user. The persist:user field stays the same as the previous login, not updating to the new user.

Has anyone run into similar issues or have any tips on how to handle this better? Any advice would be greatly appreciated!

Thanks in advance!

I am having basically the same question.
Creating guest accounts by passing the login token is not available in the Unreal Engine SDK. Would be awesome to have this option.

It is possible to do this without a front end browser by triggering a backend node.js function and using puppeteer to load the “https://{your-subdomain}.readyplayer.me/avatar?frameApi&token={token}” URL and accessing the JWT token.

But still a custom c++ function needs to be written to login guest accounts. (This would be a help already having it in the SDK) and the backend or frontend browser solution is not great.

Would be awesome to have something like this in the unreal engine :slight_smile:

Actually now I am thinking about this, this might be the wrong approach.

Instead of getting the token from the URL, the user id should be stored and a new auth token requested each time to be secure.
But what is missing for the unreal engine SDK is to sign in with this auth token directly into the custom avatar creator. Or I am missing something simple.