Skip to content

Eosu 404 auth token reauth p2p disconnects#1237

Open
JessTello wants to merge 7 commits intorelease-6.0.2from
eosu-404-auth-token-reauth-p2p-disconnects
Open

Eosu 404 auth token reauth p2p disconnects#1237
JessTello wants to merge 7 commits intorelease-6.0.2from
eosu-404-auth-token-reauth-p2p-disconnects

Conversation

@JessTello
Copy link
Contributor

Added Connect AuthExpiration notify registration with minimal diagnostic logging

  • Cached the last Connect LoginOptions and credential type to support safe re-auth attempts
  • Implemented PUID change detection to log when the ProductUserId remains stable or changes mid-session
  • Introduced a reauth-in-progress guard to prevent concurrent Connect.Login storms during token refresh
  • Added a debug hook to force a Connect re-login using a fresh Epic IdToken (CopyIdToken -> Connect.Login)

DanF-ApexSystems and others added 2 commits February 10, 2026 11:05
- Added Connect AuthExpiration notify registration with minimal diagnostic logging
- Cached the last Connect LoginOptions and credential type to support safe re-auth attempts
- Implemented PUID change detection to log when the ProductUserId remains stable or changes mid-session
- Introduced a reauth-in-progress guard to prevent concurrent Connect.Login storms during token refresh
- Added a debug hook to force a Connect re-login using a fresh Epic IdToken (CopyIdToken -> Connect.Login)
{
Debug.LogWarning(
$"{nameof(EOSManager)} Connect auth expired but last credential type was {s_lastConnectCredentialType}. " +
$"Plugin cannot refresh that token automatically. Game should re-fetch external token and call StartConnectLoginWithOptions again.");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there documentation for this? It's a bit of an unusual case where it handles it in certain circumstances

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added handling for auth-expiration by credential type: we only auto-refresh when the last Connect credential is EpicIdToken (via fresh CopyIdToken -> Connect.Login). For other credential types we log a warning and require the game to re-fetch the external token and re-initiate StartConnectLoginWithOptions.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What I mean is that this is only something that developers will see when running the game for long enough that auth expires. Also, in a specific case the plugin is handling re-authing for them, so it would be easy for someone to miss this on other platforms. It would be good to get documentation added that covers this to avoid support tickets

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the new commit on line 1830 I added a very detailed comment. Please let me know if this is enough or if you prefer that I include an XML in the documentation.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yea, adding a markdown file to the documentation is what I mean

@JessTello JessTello force-pushed the eosu-404-auth-token-reauth-p2p-disconnects branch from 9d7ab44 to 1fa8dd5 Compare February 21, 2026 00:57
- Updated new diagnostics to use the Log() wrapper instead of Debug.Log
- Moved OnConnectLogin call into the finally block
- Prevented onLoginCallback from being called twice
- Removed Debug_RefreshConnectLoginWithFreshEpicIdToken() debug helper
- Fixed variable name for better readability and consistency
- Added handling for auth-expiration: if credential type isn't EpicIdToken, log warning and require game to re-fetch the token.
- Added safety check to prevent silently overwriting the local PUID if a different ProductUserId is returned.
- Reduced duplication by making RefreshConnectLoginWithFreshEpicIdToken() reuse the StartConnectLoginWithEpicAccount() flow where applicable.
@JessTello JessTello force-pushed the eosu-404-auth-token-reauth-p2p-disconnects branch from 1fa8dd5 to 7da495b Compare February 21, 2026 00:59
@DanF-ApexSystems
Copy link
Contributor

Once requested changes are resolved, please retarget to release-6.0.2

…uth policy

- Always invoke OnConnectLogin / onloginCallback from finally (exactly-once).
- Add inline docs for auth-expiration credential policy.
- Remove unused caching and minor handler cleanup
@JessTello JessTello changed the base branch from release-6.0.1 to release-6.0.2 February 24, 2026 14:02
Removed ignore PUID change early-return so cached LocalProductUserId always stays consistent with the SDK
- Revised token refresh policy documentation to clearly differentiate EpicIdToken flows from external credential flows.
- Downgraded ProductUserId runtime-change message from Error to Warning to better reflect non-fatal behavior.
- Removed redundant comments referencing restrictions on logging.
@JessTello JessTello requested a review from matt-clarke March 9, 2026 22:04
{
Debug.LogWarning(
$"{nameof(EOSManager)} Connect auth expired but last credential type was {s_lastConnectCredentialType}. " +
$"Plugin cannot refresh that token automatically. Game should re-fetch external token and call StartConnectLoginWithOptions again.");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yea, adding a markdown file to the documentation is what I mean

Log($"[EOS][AuthExp] received. CredentialType={s_lastConnectCredentialType}", LogType.Warning);

// Prevent concurrent re-auth attempts from repeated expiration notifications.
if (Interlocked.Exchange(ref s_connectReauthInProgress, 1) == 1)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Discussion in the thread about whether locking is required is still ongoing in the thread

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants