New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

cryptum-spartantoken-retriever

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cryptum-spartantoken-retriever

Easily retrieve your SpartanToken and start interacting with Halo games API

0.0.2
Source
npm
Version published
Maintainers
1
Created
Source

Cryptum: SpartanToken

N|Solid

What is this?

SpartanToken allows anyone to easily retrieve a v3 SpartanToken Authorization (X-343-Authorization-Spartan) and start interacting with Halo games API.

Basic usages

import SpartanTokenRetriever from 'cryptum-spartantoken-retriever'

// Requires Xbox LIVE credentials
const SpartanToken = new SpartanTokenRetriever(
    'email@xboxlive.com',
    'password'
);

SpartanToken.retrieve()
.then(spartanToken => console.log(spartanToken))
.catch(error => console.log(error.getFormatedError()));
 

Success output:

{
   "AccountStatus": 0,
   "SpartanToken": "v3=U:XXXXXX;YYY...",
   "Gamertag": "Le ZeNy",
   "AnalyticsToken": "...",
   "V3Preamble": "v3=",
   "V3Token": "YYY...",
   "Players": [
      {
         "AnalyticsToken": "...",
         "Subject": "U:XXXXXX",
         "Gamertag": "Le ZeNy",
         "Xuid": "...",
         "SpartanClaims": []
      }
   ],
   "ExpiresUtc": {
      "ISO8601Date": "2017-08-21T12:12:00.187Z"
   },
   "Links": [
      {
         "Absolute": false,
         "Relationship": 0,
         "Uri": "/spartan-token"
      }
   ]
}

Error output (wrong credentials):

{
    code: 11,
    status: 401,
    message: 'Unauthorized',
    reason: 'UNAUTHORIZED'
}

Errors

Methods:

  • error.getFormatedError() — Pretty print the last error.

  • error.getReason(): — Return error reason.

  • error.getCode(): — Return error code.

  • error.getMessage(): — Return error message.

  • error.getStack(): — Return error stack trace.

  • error.getHTTPStatus(): — Return error HTTP status.

HTTP Status:

  • 400: Bad Request
  • 401: Unauthorized
  • 403: Authentication Required
  • 500: Internal Error

Want to contribute?

Feel free to open a pull request or an issue on GitHub!

Any questions?

Tweet me at @_SuckMyLuck or message me on Reddit!

Licence

MIT

Keywords

spartan

FAQs

Package last updated on 21 Aug 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts