The login process is made up of four key components:
- CSRF
- Login
- Captcha
- MFA
- Redirect
- Set SID
To log in, we must perform a precise dance between handling errors, managing headers, and storing cookies. I won't document the entire process in detail, but a summary looks like this:
- Call CSRF, remember the token
- Call login with CSRF header
- If login errors with
session_invalidated
- Go back to 1.
- If login errors with
captcha_invalid
- Solve a captcha, remember the captcha token
- Go back to 1. with the captcha token
- If login errors with
two_factor_authentication.required
- Call CSRF
- Call MFA with TOTP code and CSRF header
- If login errors with
- Call redirect with CSRF header, remember the SID
- Call Set SID
Make a call to the redirect endpoint with a valid EPIC_SESSION_AP
cookie to refresh your credential cookies.
rememberMe: false
during login will give you 8 hour cookies. rememberMe: true
will give you 30 day cookies.
rememberMe: true
response sets the cookies:
Name | Max-Age |
---|---|
EPIC_SSO | 28800 |
EPIC_BEARER_TOKEN | 28800 |
EPIC_SSO_RM | 2592000 |
EPIC_SESSION_AP | 2592000 |
To determine if you own a game, use the entitledOfferItems
GraphQL query. This will return entitledToAllItemsInOffer: boolean
and entitledToAnyItemInOffer: boolean
. The two variables make up various states of purchasability.
entitledToAllItemsInOffer = true |
entitledToAllItemsInOffer = false |
|
---|---|---|
entitledToAnyItemInOffer = true |
Already owned | Coming soon |
entitledToAnyItemInOffer = false |
TBD | Purchasable |
A general overview of the purchase process. See the code for specifics.
- Logged in
- offerId of game to be purchased
- namespaceId of game to be purchased
- Call
/store/purchase
with the namespaceId and offerId as parameters.- Remember the purchase token located at
<input id="purchaseToken">
in the HTML document
- Remember the purchase token located at
- (Optional) Call Safetech with the purchase token as a parameter
- Doesn't seem necessary as of now
- Call order preview with the namespaceId and offerId in the body, and the purchase token in a header
- Remember the order preview response
- Call confirm order with essentially the contents of order preview, and the purchase token in a header