Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@xboxreplay/xboxlive-auth

Package Overview
Dependencies
Maintainers
1
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@xboxreplay/xboxlive-auth - npm Package Compare versions

Comparing version 0.0.3 to 0.1.0

4

dist/index.d.ts

@@ -1,2 +0,4 @@

import { IAuthUserResponse, IAuthOptions } from './__typings__';
import { IExchangeUserTokenResponse, IAuthUserResponse, IAuthOptions } from './__typings__';
export declare const exchangeAccessTokenForUserToken: (accessToken: string) => Promise<string>;
export declare const exchangeUserTokenForXSTSIdentity: (userToken: string, XSTSRelyingParty?: string) => Promise<IExchangeUserTokenResponse>;
export declare const authenticate: (email: string, password: string, options?: IAuthOptions) => Promise<IAuthUserResponse>;

@@ -98,7 +98,8 @@ "use strict";

});
const _exchangeAccessTokenForUserToken = (accessToken) => new Promise((resolve, reject) => {
// ***** PUBLIC METHODS ***** //
exports.exchangeAccessTokenForUserToken = (accessToken) => new Promise((resolve, reject) => {
request({
uri: __typings__1.XboxLiveEndpoints.UserAuthenticate,
method: 'POST',
headers: BASE_HEADERS,
headers: Object.assign({}, BASE_HEADERS, { 'x-xbl-contract-version': 0 }),
json: {

@@ -121,7 +122,7 @@ RelyingParty: 'http://auth.xboxlive.com',

});
const _exchangeUserTokenForXSTSIdentity = (userToken, XSTSRelyingParty = 'http://xboxlive.com') => new Promise((resolve, reject) => {
exports.exchangeUserTokenForXSTSIdentity = (userToken, XSTSRelyingParty = 'http://xboxlive.com') => new Promise((resolve, reject) => {
request({
uri: __typings__1.XboxLiveEndpoints.XSTSAuthorize,
method: 'POST',
headers: BASE_HEADERS,
headers: Object.assign({}, BASE_HEADERS, { 'x-xbl-contract-version': 0 }),
json: {

@@ -146,8 +147,7 @@ RelyingParty: XSTSRelyingParty,

});
// ***** PUBLIC METHODS ***** //
exports.authenticate = (email, password, options = {}) => __awaiter(this, void 0, void 0, function* () {
const preAuthResponse = yield _preAuth();
const logUser = yield _logUser(preAuthResponse, { email, password });
const userToken = yield _exchangeAccessTokenForUserToken(logUser.accessToken);
return _exchangeUserTokenForXSTSIdentity(userToken, options.XSTSRelyingParty);
const userToken = yield exports.exchangeAccessTokenForUserToken(logUser.accessToken);
return exports.exchangeUserTokenForXSTSIdentity(userToken, options.XSTSRelyingParty);
});
{
"name": "@xboxreplay/xboxlive-auth",
"description": "Simple Xbox Live authentication module.",
"version": "0.0.3",
"version": "0.1.0",
"keywords": ["xboxreplay", "xboxlive", "auth"],
"types": "./dist/index.d.ts",
"repository": {

@@ -7,0 +8,0 @@ "type": "git",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc