Socket
Socket
Sign inDemoInstall

node-sp-auth

Package Overview
Dependencies
Maintainers
1
Versions
67
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-sp-auth - npm Package Compare versions

Comparing version 2.5.7 to 2.5.8

2

lib/src/auth/HostingEnvironment.d.ts

@@ -6,3 +6,3 @@ export declare enum HostingEnvironment {

USGovernment = 3,
USDefence = 4
USDefence = 4,
}

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

/// <reference types="bluebird" />
import * as Promise from 'bluebird';

@@ -2,0 +3,0 @@ import { IAuthResponse } from './IAuthResponse';

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

/// <reference types="bluebird" />
import * as Promise from 'bluebird';

@@ -11,3 +12,3 @@ import { IAuthResolver } from './../IAuthResolver';

getAuth(): Promise<IAuthResponse>;
private postTokenData;
private postTokenData(samlAssertion);
}

@@ -44,3 +44,3 @@ "use strict";

}
return AdfsHelper_1.AdfsHelper.getSamlAssertion(this._siteUrl, this._authOptions)
return AdfsHelper_1.AdfsHelper.getSamlAssertion(this._authOptions)
.then(data => {

@@ -47,0 +47,0 @@ return this.postTokenData(data);

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

/// <reference types="bluebird" />
import * as Promise from 'bluebird';

@@ -2,0 +3,0 @@ import { IAuthResolver } from '../../IAuthResolver';

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

/// <reference types="bluebird" />
import * as Promise from 'bluebird';

@@ -9,3 +10,3 @@ import { IAuthResolver } from '../IAuthResolver';

getAuth(): Promise<IAuthResponse>;
private findBestMatch;
private findBestMatch(fileNameTemplate, fileNames);
}

@@ -18,4 +18,4 @@ const electron = require('electron');

const createWindow = () => {
let siteUrl = process.argv[3];
let force = process.argv[4] === 'true';
let siteUrl = process.argv[2];
let force = process.argv[3] === 'true';
if (siteUrl.endsWith('/')) {

@@ -22,0 +22,0 @@ siteUrl = siteUrl.slice(0, -1);

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

/// <reference types="bluebird" />
import * as Promise from 'bluebird';

@@ -18,5 +19,5 @@ import { IAuthResolver } from '../../IAuthResolver';

getAuth(): Promise<IAuthResponse>;
private getMaxExpiration;
private saveAuthData;
private getDataFilePath;
private getMaxExpiration(cookies);
private saveAuthData(dataPath);
private getDataFilePath();
}

@@ -80,3 +80,3 @@ "use strict";

let options = isWindows ? { shell: true } : undefined;
const output = childProcess.execFileSync(electronExecutable, [path.join(__dirname, 'electron/main.js'), '--', this._siteUrl, this._authOptions.force.toString()], options).toString();
const output = childProcess.execFileSync(electronExecutable, [path.join(__dirname, 'electron/main.js'), this._siteUrl, this._authOptions.force.toString()], options).toString();
let cookieRegex = /#\{([\s\S]+?)\}#/gm;

@@ -83,0 +83,0 @@ let cookieData = cookieRegex.exec(output);

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

/// <reference types="bluebird" />
import * as Promise from 'bluebird';

@@ -11,5 +12,5 @@ import { IOnlineAddinCredentials } from './../IAuthOptions';

protected InitEndpointsMappings(): void;
private getAuthUrl;
private getAuthUrl(realm);
private readonly AcsRealmUrl;
private getRealm;
private getRealm(siteUrl);
}

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

/// <reference types="bluebird" />
import * as Promise from 'bluebird';

@@ -11,8 +12,8 @@ import { IUserCredentials } from './../IAuthOptions';

protected InitEndpointsMappings(): void;
private getSecurityToken;
private getSecurityTokenWithAdfs;
private getSecurityTokenWithOnline;
private postToken;
private getSecurityToken();
private getSecurityTokenWithAdfs(adfsUrl, relyingParty);
private getSecurityTokenWithOnline();
private postToken(xmlResponse);
private readonly MSOnlineSts;
private readonly OnlineUserRealmEndpoint;
}

@@ -98,3 +98,3 @@ "use strict";

if (authType === 'Federated') {
return this.getSecurityTokenWithAdfs(userRealm.AuthURL);
return this.getSecurityTokenWithAdfs(userRealm.AuthURL, userRealm.CloudInstanceIssuerUri);
}

@@ -104,8 +104,8 @@ throw new Error(`Unable to resolve namespace authentiation type. Type received: ${authType}`);

}
getSecurityTokenWithAdfs(adfsUrl) {
return AdfsHelper_1.AdfsHelper.getSamlAssertion(this._siteUrl, {
getSecurityTokenWithAdfs(adfsUrl, relyingParty) {
return AdfsHelper_1.AdfsHelper.getSamlAssertion({
username: this._authOptions.username,
password: this._authOptions.password,
adfsUrl: adfsUrl,
relyingParty: consts.AdfsOnlineRealm
relyingParty: relyingParty || consts.AdfsOnlineRealm
})

@@ -112,0 +112,0 @@ .then(samlAssertion => {

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

/// <reference types="bluebird" />
import * as Promise from 'bluebird';

@@ -2,0 +3,0 @@ import { IAuthResolver } from './../IAuthResolver';

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

/// <reference types="bluebird" />
import * as Promise from 'bluebird';

@@ -2,0 +3,0 @@ import { IAuthResolver } from './../IAuthResolver';

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

/// <reference types="bluebird" />
import * as Promise from 'bluebird';

@@ -2,0 +3,0 @@ import { IAuthResolver } from './../IAuthResolver';

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

/// <reference types="bluebird" />
import * as Promise from 'bluebird';

@@ -2,0 +3,0 @@ import { IAuthResolver } from './../IAuthResolver';

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

/// <reference types="bluebird" />
import * as Promise from 'bluebird';

@@ -2,0 +3,0 @@ import { IAuthResponse } from './auth/IAuthResponse';

@@ -1,1 +0,1 @@

export declare const template = "\n <t:RequestSecurityTokenResponse xmlns:t=\"http://schemas.xmlsoap.org/ws/2005/02/trust\">\n <t:Lifetime>\n <wsu:Created xmlns:wsu=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd\"><%= created %></wsu:Created>\n <wsu:Expires xmlns:wsu=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd\"><%= expires %></wsu:Expires>\n </t:Lifetime>\n <wsp:AppliesTo xmlns:wsp=\"http://schemas.xmlsoap.org/ws/2004/09/policy\">\n <wsa:EndpointReference xmlns:wsa=\"http://www.w3.org/2005/08/addressing\">\n <wsa:Address><%= relyingParty %></wsa:Address>\n </wsa:EndpointReference>\n </wsp:AppliesTo>\n <t:RequestedSecurityToken><%= token %></t:RequestedSecurityToken>\n <t:TokenType>urn:oasis:names:tc:SAML:1.0:assertion</t:TokenType>\n <t:RequestType>http://schemas.xmlsoap.org/ws/2005/02/trust/Issue</t:RequestType>\n <t:KeyType>http://schemas.xmlsoap.org/ws/2005/05/identity/NoProofKey</t:KeyType>\n </t:RequestSecurityTokenResponse>\n";
export declare const template: string;

@@ -1,1 +0,1 @@

export declare const template = "\n <s:Envelope xmlns:s=\"http://www.w3.org/2003/05/soap-envelope\" xmlns:a=\"http://www.w3.org/2005/08/addressing\" xmlns:u=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd\">\n <s:Header>\n <a:Action s:mustUnderstand=\"1\">http://docs.oasis-open.org/ws-sx/ws-trust/200512/RST/Issue</a:Action>\n <a:ReplyTo>\n <a:Address>http://www.w3.org/2005/08/addressing/anonymous</a:Address>\n </a:ReplyTo>\n <a:To s:mustUnderstand=\"1\"><%= to %></a:To>\n <o:Security s:mustUnderstand=\"1\" xmlns:o=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd\">\n <o:UsernameToken u:Id=\"uuid-7b105801-44ac-4da7-aa69-a87f9db37299-1\">\n <o:Username><%= username %></o:Username>\n <o:Password Type=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText\"><%= password %></o:Password>\n </o:UsernameToken>\n </o:Security>\n </s:Header>\n <s:Body>\n <trust:RequestSecurityToken xmlns:trust=\"http://docs.oasis-open.org/ws-sx/ws-trust/200512\">\n <wsp:AppliesTo xmlns:wsp=\"http://schemas.xmlsoap.org/ws/2004/09/policy\">\n <wsa:EndpointReference xmlns:wsa=\"http://www.w3.org/2005/08/addressing\">\n <wsa:Address><%= relyingParty %></wsa:Address>\n </wsa:EndpointReference>\n </wsp:AppliesTo>\n <trust:KeyType>http://docs.oasis-open.org/ws-sx/ws-trust/200512/Bearer</trust:KeyType>\n <trust:RequestType>http://docs.oasis-open.org/ws-sx/ws-trust/200512/Issue</trust:RequestType>\n </trust:RequestSecurityToken>\n </s:Body>\n </s:Envelope>\n";
export declare const template: string;

@@ -1,1 +0,1 @@

export declare const template = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n <soap:Envelope xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">\n <soap:Body>\n <Login xmlns=\"http://schemas.microsoft.com/sharepoint/soap/\">\n <username><%= username %></username>\n <password><%= password %></password>\n </Login>\n </soap:Body>\n </soap:Envelope>\n";
export declare const template: string;

@@ -1,1 +0,1 @@

export declare const template = "\n <s:Envelope xmlns:s=\"http://www.w3.org/2003/05/soap-envelope\" xmlns:a=\"http://www.w3.org/2005/08/addressing\" xmlns:u=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd\">\n <s:Header>\n <a:Action s:mustUnderstand=\"1\">http://schemas.xmlsoap.org/ws/2005/02/trust/RST/Issue</a:Action>\n <a:ReplyTo>\n <a:Address>http://www.w3.org/2005/08/addressing/anonymous</a:Address>\n </a:ReplyTo>\n <a:To s:mustUnderstand=\"1\">https://login.microsoftonline.com/extSTS.srf</a:To>\n <o:Security s:mustUnderstand=\"1\" xmlns:o=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd\">\n <o:UsernameToken>\n <o:Username><%= username %></o:Username>\n <o:Password><%= password %></o:Password>\n </o:UsernameToken>\n </o:Security>\n </s:Header>\n <s:Body>\n <t:RequestSecurityToken xmlns:t=\"http://schemas.xmlsoap.org/ws/2005/02/trust\">\n <wsp:AppliesTo xmlns:wsp=\"http://schemas.xmlsoap.org/ws/2004/09/policy\">\n <a:EndpointReference>\n <a:Address><%= endpoint %></a:Address>\n </a:EndpointReference>\n </wsp:AppliesTo>\n <t:KeyType>http://schemas.xmlsoap.org/ws/2005/05/identity/NoProofKey</t:KeyType>\n <t:RequestType>http://schemas.xmlsoap.org/ws/2005/02/trust/Issue</t:RequestType>\n <t:TokenType>urn:oasis:names:tc:SAML:1.0:assertion</t:TokenType>\n </t:RequestSecurityToken>\n </s:Body>\n </s:Envelope>\n";
export declare const template: string;

@@ -1,1 +0,1 @@

export declare const template = "\n <s:Envelope xmlns:s=\"http://www.w3.org/2003/05/soap-envelope\" xmlns:a=\"http://www.w3.org/2005/08/addressing\" xmlns:u=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd\">\n <s:Header>\n <a:Action s:mustUnderstand=\"1\">http://schemas.xmlsoap.org/ws/2005/02/trust/RST/Issue</a:Action>\n <a:ReplyTo>\n <a:Address>http://www.w3.org/2005/08/addressing/anonymous</a:Address>\n </a:ReplyTo>\n <a:To s:mustUnderstand=\"1\">https://login.microsoftonline.com/extSTS.srf</a:To>\n <o:Security s:mustUnderstand=\"1\" xmlns:o=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd\"><%= token %></o:Security>\n </s:Header>\n <s:Body>\n <t:RequestSecurityToken xmlns:t=\"http://schemas.xmlsoap.org/ws/2005/02/trust\">\n <wsp:AppliesTo xmlns:wsp=\"http://schemas.xmlsoap.org/ws/2004/09/policy\">\n <a:EndpointReference>\n <a:Address><%= endpoint %></a:Address>\n </a:EndpointReference>\n </wsp:AppliesTo>\n <t:KeyType>http://schemas.xmlsoap.org/ws/2005/05/identity/NoProofKey</t:KeyType>\n <t:RequestType>http://schemas.xmlsoap.org/ws/2005/02/trust/Issue</t:RequestType>\n <t:TokenType>urn:oasis:names:tc:SAML:1.0:assertion</t:TokenType>\n </t:RequestSecurityToken>\n </s:Body>\n </s:Envelope>\n";
export declare const template: string;

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

/// <reference types="bluebird" />
import * as Promise from 'bluebird';

@@ -5,3 +6,3 @@ import { IAdfsUserCredentials } from './../auth/IAuthOptions';

export declare class AdfsHelper {
static getSamlAssertion(siteUrl: string, credentials: IAdfsUserCredentials): Promise<SamlAssertion>;
static getSamlAssertion(credentials: IAdfsUserCredentials): Promise<SamlAssertion>;
}

@@ -9,3 +9,3 @@ "use strict";

class AdfsHelper {
static getSamlAssertion(siteUrl, credentials) {
static getSamlAssertion(credentials) {
let adfsHost = url.parse(credentials.adfsUrl).host;

@@ -12,0 +12,0 @@ let usernameMixedUrl = `https://${adfsHost}/adfs/services/trust/13/usernamemixed`;

@@ -7,3 +7,3 @@ export declare class Cache {

clear(): void;
private getHashKey;
private getHashKey(key);
}
export declare class CacheItem {
data: any;
expiredOn?: Date;
expiredOn: Date;
constructor(data: any, expiredOn?: Date);
}
export declare class FilesHelper {
static getUserDataFolder(): string;
static resolveFileName(siteUrl: string): string;
private static resolveSiteUrl;
private static resolveSiteUrl(siteUrl);
}

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

/// <reference types="bluebird" />
import * as Promise from 'bluebird';

@@ -2,0 +3,0 @@ import { IAppToken } from '../auth/base/IAppToken';

{
"version": "2.5.7",
"version": "2.5.8",
"name": "node-sp-auth",

@@ -4,0 +4,0 @@ "author": "Sergei Sergeev <sergeev.srg@gmail.com> (https://github.com/s-KaiNet)",

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