Skip to content

Instantly share code, notes, and snippets.

View Lucas7yoshi's full-sized avatar

Lucas Lucas7yoshi

View GitHub Profile
@Lucas7yoshi
Lucas7yoshi / FortniteAuth.cs
Created September 21, 2019 04:35
Fortnite authorization grabber, gets you the eg1 token. Requires newtonsoft.json and RestSharp. Pass as "Authorization" "bearer " + the resulting token to get endpoints.
public string getAuthFullFlow(string username, string password)
{
var cli1 = new RestClient("https://www.epicgames.com/id/api/csrf");
var req1 = new RestRequest(Method.GET);
var ans1 = cli1.Execute(req1);
var xsrftoken = ans1.Cookies.First(x => x.Name == "XSRF-TOKEN").Value;
var cli2 = new RestClient("https://www.epicgames.com/id/api/login");
var req2 = new RestRequest(Method.POST);
foreach (var i in ans1.Cookies)