Giter Club home page Giter Club logo

gf-login's Introduction

@zakku/gf-login

A node.js library for authenticating to GameFail's servers.

Prerequisites

For this library to work it is required to have openssl installed on your system.

Note: Versions prior to 2.0.0 doesn't require openssl but are bigger in size.

Installation

NPM:

npm install @zakku/gf-login

Yarn:

yarn add @zakku/gf-login

PNPM:

pnpm add @zakku/gf-login

Example Usage

import {
    getGameforgeClientVersion,
    CertificateStore,
    getAccountToken,
    getGameAccounts,
    getGameToken,
    convertNostaleToken
} from "@zakku/gf-login";

const installationId = "8cd369b7-3f73-47c4-bf57-3544201ec275";
const clientVersion = await getGameforgeClientVersion();
const certStore = await CertificateStore.create(
    "./cert.p12", 
    "secret_gf_cert_password"
);

const authToken = await getAccountToken(
    "[email protected]",
    "gfpls",
    installationId
);

const gameAccount = (await getGameAccounts(authToken, installationId))
    .find(acc => acc.accountName === "make_nostale_greate_again");

const gameToken = await getGameToken(
    authToken,
    gameAccount,
    installationId,
    clientVersion,
    certStore
);

const loginSession = convertNostaleToken(gameToken);

Credits

  • Special thanks to Xeno and Lank for the help in reverse engineering the User-Agent "magic" hash and a method for extracting the client's certificates.

gf-login's People

Contributors

dependabot[bot] avatar zakuciael avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

gf-login's Issues

Game Token is not working now

Response: { error: { message: 'Not allowed to create code' } }

for your info:
API /api/v1/auth/thin/codes request payload updated:
{
platformGameAccountId: "",
blackbox: ""
}

And three API call before /api/v1/auth/thin/codes

  1. https://events2.gameforge.com/
{
	"client_installation_id": "",
	"client_locale": "",
	"client_session_id": "",
	"client_version_info": {
		"branch": "master",
		"commit_id": "636a4245",
		"version": "2.1.32.1206"
	},
	"game_account_id": "",
	"game_id": "",
	"id": 0,
	"localtime": "",
	"session_id": "",
	"start_option": "",
	"type": "game_started"
}
  1. https://events2.gameforge.com/
{
	"account_id": "",
	"client_installation_id": "",
	"client_locale": "",
	"client_session_id": "",
	"game_id": "",
	"id": 0,
	"localtime": "",
	"playtime_counter": 1,
	"playtime_session_id": "",
	"product": "nostale",
	"qwevent": "PLAYTIME_START",
	"type": "PLAYTIME_START",
	"user_id": ""
}
  1. https://events2.gameforge.com/
{
	"client_installation_id": "",
	"client_locale": "",
	"client_session_id": "",
	"email_hash": "",
	"game_account_id": "",
	"game_locale": "",
	"id": ,
	"localtime": "",
	"operating_system": "",
	"operating_system_version": "",
	"product": "nostale",
	"qwevent": "TNT_migration",
	"result": "success",
	"start_option": "",
	"type": "game_launch",
	"user_id": ""
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.