samlify 2.12.0 → 2.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (84) hide show
  1. package/README.md +1 -1
  2. package/build/src/api.js +41 -3
  3. package/build/src/api.js.map +1 -1
  4. package/build/src/binding-post.js +236 -182
  5. package/build/src/binding-post.js.map +1 -1
  6. package/build/src/binding-redirect.js +303 -215
  7. package/build/src/binding-redirect.js.map +1 -1
  8. package/build/src/binding-simplesign.js +285 -137
  9. package/build/src/binding-simplesign.js.map +1 -1
  10. package/build/src/entity-idp.js +130 -47
  11. package/build/src/entity-idp.js.map +1 -1
  12. package/build/src/entity-sp.js +81 -39
  13. package/build/src/entity-sp.js.map +1 -1
  14. package/build/src/entity.js +100 -62
  15. package/build/src/entity.js.map +1 -1
  16. package/build/src/extractor.js +118 -151
  17. package/build/src/extractor.js.map +1 -1
  18. package/build/src/flow.js +100 -96
  19. package/build/src/flow.js.map +1 -1
  20. package/build/src/libsaml.js +315 -259
  21. package/build/src/libsaml.js.map +1 -1
  22. package/build/src/metadata-idp.js +60 -30
  23. package/build/src/metadata-idp.js.map +1 -1
  24. package/build/src/metadata-sp.js +51 -41
  25. package/build/src/metadata-sp.js.map +1 -1
  26. package/build/src/metadata.js +47 -43
  27. package/build/src/metadata.js.map +1 -1
  28. package/build/src/options.js +73 -0
  29. package/build/src/options.js.map +1 -0
  30. package/build/src/urn.js +28 -1
  31. package/build/src/urn.js.map +1 -1
  32. package/build/src/utility.js +140 -85
  33. package/build/src/utility.js.map +1 -1
  34. package/build/src/validator.js +27 -10
  35. package/build/src/validator.js.map +1 -1
  36. package/package.json +16 -5
  37. package/types/src/api.d.ts +33 -3
  38. package/types/src/binding-post.d.ts +67 -34
  39. package/types/src/binding-redirect.d.ts +58 -31
  40. package/types/src/binding-simplesign.d.ts +77 -21
  41. package/types/src/entity-idp.d.ts +40 -31
  42. package/types/src/entity-sp.d.ts +37 -27
  43. package/types/src/entity.d.ts +71 -77
  44. package/types/src/extractor.d.ts +31 -22
  45. package/types/src/flow.d.ts +24 -2
  46. package/types/src/libsaml.d.ts +172 -118
  47. package/types/src/metadata-idp.d.ts +27 -11
  48. package/types/src/metadata-sp.d.ts +29 -19
  49. package/types/src/metadata.d.ts +59 -34
  50. package/types/src/options.d.ts +37 -0
  51. package/types/src/types.d.ts +250 -24
  52. package/types/src/urn.d.ts +7 -0
  53. package/types/src/utility.d.ts +139 -90
  54. package/types/src/validator.d.ts +21 -0
  55. package/.circleci/config.yml +0 -98
  56. package/.editorconfig +0 -19
  57. package/.github/FUNDING.yml +0 -1
  58. package/.github/workflows/deploy-docs.yml +0 -56
  59. package/.pre-commit.sh +0 -15
  60. package/.snyk +0 -4
  61. package/Makefile +0 -25
  62. package/index.ts +0 -28
  63. package/samlify-2.11.0.tgz +0 -0
  64. package/src/api.ts +0 -48
  65. package/src/binding-post.ts +0 -336
  66. package/src/binding-redirect.ts +0 -335
  67. package/src/binding-simplesign.ts +0 -231
  68. package/src/entity-idp.ts +0 -145
  69. package/src/entity-sp.ts +0 -114
  70. package/src/entity.ts +0 -243
  71. package/src/extractor.ts +0 -399
  72. package/src/flow.ts +0 -469
  73. package/src/libsaml.ts +0 -779
  74. package/src/metadata-idp.ts +0 -146
  75. package/src/metadata-sp.ts +0 -203
  76. package/src/metadata.ts +0 -166
  77. package/src/types.ts +0 -127
  78. package/src/urn.ts +0 -210
  79. package/src/utility.ts +0 -259
  80. package/src/validator.ts +0 -44
  81. package/tsconfig.json +0 -41
  82. package/tslint.json +0 -35
  83. package/types.d.ts +0 -2
  84. package/vitest.config.ts +0 -12
@@ -1,146 +0,0 @@
1
- /**
2
- * @file metadata-idp.ts
3
- * @author tngan
4
- * @desc Metadata of identity provider
5
- */
6
- import Metadata, { MetadataInterface } from './metadata';
7
- import { MetadataIdpOptions, MetadataIdpConstructor } from './types';
8
- import { namespace } from './urn';
9
- import libsaml from './libsaml';
10
- import { castArrayOpt, isNonEmptyArray, isString } from './utility';
11
- import xml from 'xml';
12
-
13
- export interface IdpMetadataInterface extends MetadataInterface {
14
-
15
- }
16
-
17
- /*
18
- * @desc interface function
19
- */
20
- export default function(meta: MetadataIdpConstructor) {
21
- return new IdpMetadata(meta);
22
- }
23
-
24
- export class IdpMetadata extends Metadata {
25
-
26
- constructor(meta: MetadataIdpConstructor) {
27
-
28
- const isFile = isString(meta) || meta instanceof Buffer;
29
-
30
- if (!isFile) {
31
-
32
- const {
33
- entityID,
34
- signingCert,
35
- encryptCert,
36
- wantAuthnRequestsSigned = false,
37
- nameIDFormat = [],
38
- singleSignOnService = [],
39
- singleLogoutService = [],
40
- } = meta as MetadataIdpOptions;
41
-
42
- const IDPSSODescriptor: any[] = [{
43
- _attr: {
44
- WantAuthnRequestsSigned: String(wantAuthnRequestsSigned),
45
- protocolSupportEnumeration: namespace.names.protocol,
46
- },
47
- }];
48
-
49
- for(const cert of castArrayOpt(signingCert)) {
50
- IDPSSODescriptor.push(libsaml.createKeySection('signing', cert));
51
- }
52
-
53
- for(const cert of castArrayOpt(encryptCert)) {
54
- IDPSSODescriptor.push(libsaml.createKeySection('encryption', cert));
55
- }
56
-
57
- if (isNonEmptyArray(nameIDFormat)) {
58
- nameIDFormat.forEach(f => IDPSSODescriptor.push({ NameIDFormat: f }));
59
- }
60
-
61
- if (isNonEmptyArray(singleSignOnService)) {
62
- singleSignOnService.forEach((a, indexCount) => {
63
- const attr: any = {
64
- Binding: a.Binding,
65
- Location: a.Location,
66
- };
67
- if (a.isDefault) {
68
- attr.isDefault = true;
69
- }
70
- IDPSSODescriptor.push({ SingleSignOnService: [{ _attr: attr }] });
71
- });
72
- } else {
73
- throw new Error('ERR_IDP_METADATA_MISSING_SINGLE_SIGN_ON_SERVICE');
74
- }
75
-
76
- if (isNonEmptyArray(singleLogoutService)) {
77
- singleLogoutService.forEach((a, indexCount) => {
78
- const attr: any = {};
79
- if (a.isDefault) {
80
- attr.isDefault = true;
81
- }
82
- attr.Binding = a.Binding;
83
- attr.Location = a.Location;
84
- IDPSSODescriptor.push({ SingleLogoutService: [{ _attr: attr }] });
85
- });
86
- } else {
87
- console.warn('Construct identity provider - missing endpoint of SingleLogoutService');
88
- }
89
- // Create a new metadata by setting
90
- meta = xml([{
91
- EntityDescriptor: [{
92
- _attr: {
93
- 'xmlns': namespace.names.metadata,
94
- 'xmlns:assertion': namespace.names.assertion,
95
- 'xmlns:ds': 'http://www.w3.org/2000/09/xmldsig#',
96
- entityID,
97
- },
98
- }, { IDPSSODescriptor }],
99
- }]);
100
- }
101
-
102
- super(meta as string | Buffer, [
103
- {
104
- key: 'wantAuthnRequestsSigned',
105
- localPath: ['EntityDescriptor', 'IDPSSODescriptor'],
106
- attributes: ['WantAuthnRequestsSigned'],
107
- },
108
- {
109
- key: 'singleSignOnService',
110
- localPath: ['EntityDescriptor', 'IDPSSODescriptor', 'SingleSignOnService'],
111
- index: ['Binding'],
112
- attributePath: [],
113
- attributes: ['Location']
114
- },
115
- ]);
116
-
117
- }
118
-
119
- /**
120
- * @desc Get the preference whether it wants a signed request
121
- * @return {boolean} WantAuthnRequestsSigned
122
- */
123
- isWantAuthnRequestsSigned(): boolean {
124
- const was = this.meta.wantAuthnRequestsSigned;
125
- if (was === undefined) {
126
- return false;
127
- }
128
- return String(was) === 'true';
129
- }
130
-
131
- /**
132
- * @desc Get the entity endpoint for single sign on service
133
- * @param {string} binding protocol binding (e.g. redirect, post)
134
- * @return {string/object} location
135
- */
136
- getSingleSignOnService(binding: string): string | object {
137
- if (isString(binding)) {
138
- const bindName = namespace.binding[binding];
139
- const service = this.meta.singleSignOnService[bindName];
140
- if (service) {
141
- return service;
142
- }
143
- }
144
- return this.meta.singleSignOnService;
145
- }
146
- }
@@ -1,203 +0,0 @@
1
- /**
2
- * @file metadata-sp.ts
3
- * @author tngan
4
- * @desc Metadata of service provider
5
- */
6
- import Metadata, { MetadataInterface } from './metadata';
7
- import { MetadataSpConstructor, MetadataSpOptions } from './types';
8
- import { namespace, elementsOrder as order } from './urn';
9
- import libsaml from './libsaml';
10
- import { castArrayOpt, isNonEmptyArray, isString } from './utility';
11
- import xml from 'xml';
12
-
13
- export interface SpMetadataInterface extends MetadataInterface {
14
-
15
- }
16
-
17
- // https://docs.oasis-open.org/security/saml/v2.0/saml-metadata-2.0-os.pdf (P.16, 18)
18
- interface MetaElement {
19
- KeyDescriptor?: any[];
20
- NameIDFormat?: any[];
21
- SingleLogoutService?: any[];
22
- AssertionConsumerService?: any[];
23
- AttributeConsumingService?: any[];
24
- }
25
-
26
- /*
27
- * @desc interface function
28
- */
29
- export default function(meta: MetadataSpConstructor) {
30
- return new SpMetadata(meta);
31
- }
32
-
33
- /**
34
- * @desc SP Metadata is for creating Service Provider, provides a set of API to manage the actions in SP.
35
- */
36
- export class SpMetadata extends Metadata {
37
-
38
- /**
39
- * @param {object/string} meta (either xml string or configuration in object)
40
- * @return {object} prototypes including public functions
41
- */
42
- constructor(meta: MetadataSpConstructor) {
43
-
44
- const isFile = isString(meta) || meta instanceof Buffer;
45
-
46
- // use object configuration instead of importing metadata file directly
47
- if (!isFile) {
48
-
49
- const {
50
- elementsOrder = order.default,
51
- entityID,
52
- signingCert,
53
- encryptCert,
54
- authnRequestsSigned = false,
55
- wantAssertionsSigned = false,
56
- wantMessageSigned = false,
57
- signatureConfig,
58
- nameIDFormat = [],
59
- singleLogoutService = [],
60
- assertionConsumerService = [],
61
- } = meta as MetadataSpOptions;
62
-
63
- const descriptors: MetaElement = {
64
- KeyDescriptor: [],
65
- NameIDFormat: [],
66
- SingleLogoutService: [],
67
- AssertionConsumerService: [],
68
- AttributeConsumingService: [],
69
- };
70
-
71
- const SPSSODescriptor: any[] = [{
72
- _attr: {
73
- AuthnRequestsSigned: String(authnRequestsSigned),
74
- WantAssertionsSigned: String(wantAssertionsSigned),
75
- protocolSupportEnumeration: namespace.names.protocol,
76
- },
77
- }];
78
-
79
- if (wantMessageSigned && signatureConfig === undefined) {
80
- console.warn('Construct service provider - missing signatureConfig');
81
- }
82
-
83
- for(const cert of castArrayOpt(signingCert)) {
84
- descriptors.KeyDescriptor!.push(libsaml.createKeySection('signing', cert).KeyDescriptor);
85
- }
86
-
87
- for(const cert of castArrayOpt(encryptCert)) {
88
- descriptors.KeyDescriptor!.push(libsaml.createKeySection('encryption', cert).KeyDescriptor);
89
- }
90
-
91
- if (isNonEmptyArray(nameIDFormat)) {
92
- nameIDFormat.forEach(f => descriptors.NameIDFormat!.push(f));
93
- } else {
94
- // default value
95
- descriptors.NameIDFormat!.push(namespace.format.emailAddress);
96
- }
97
-
98
- if (isNonEmptyArray(singleLogoutService)) {
99
- singleLogoutService.forEach(a => {
100
- const attr: any = {
101
- Binding: a.Binding,
102
- Location: a.Location,
103
- };
104
- if (a.isDefault) {
105
- attr.isDefault = true;
106
- }
107
- descriptors.SingleLogoutService!.push([{ _attr: attr }]);
108
- });
109
- }
110
-
111
- if (isNonEmptyArray(assertionConsumerService)) {
112
- let indexCount = 0;
113
- assertionConsumerService.forEach(a => {
114
- const attr: any = {
115
- index: String(indexCount++),
116
- Binding: a.Binding,
117
- Location: a.Location,
118
- };
119
- if (a.isDefault) {
120
- attr.isDefault = true;
121
- }
122
- descriptors.AssertionConsumerService!.push([{ _attr: attr }]);
123
- });
124
- } else {
125
- // console.warn('Missing endpoint of AssertionConsumerService');
126
- }
127
-
128
- // handle element order
129
- const existedElements = elementsOrder.filter(name => isNonEmptyArray(descriptors[name]));
130
- existedElements.forEach(name => {
131
- descriptors[name].forEach(e => SPSSODescriptor.push({ [name]: e }));
132
- });
133
-
134
- // Re-assign the meta reference as a XML string|Buffer for use with the parent constructor
135
- meta = xml([{
136
- EntityDescriptor: [{
137
- _attr: {
138
- entityID,
139
- 'xmlns': namespace.names.metadata,
140
- 'xmlns:assertion': namespace.names.assertion,
141
- 'xmlns:ds': 'http://www.w3.org/2000/09/xmldsig#',
142
- },
143
- }, { SPSSODescriptor }],
144
- }]);
145
-
146
- }
147
-
148
- // Use the re-assigned meta object reference here
149
- super(meta as string | Buffer, [
150
- {
151
- key: 'spSSODescriptor',
152
- localPath: ['EntityDescriptor', 'SPSSODescriptor'],
153
- attributes: ['WantAssertionsSigned', 'AuthnRequestsSigned'],
154
- },
155
- {
156
- key: 'assertionConsumerService',
157
- localPath: ['EntityDescriptor', 'SPSSODescriptor', 'AssertionConsumerService'],
158
- attributes: ['Binding', 'Location', 'isDefault', 'index'],
159
- }
160
- ]);
161
-
162
- }
163
-
164
- /**
165
- * @desc Get the preference whether it wants a signed assertion response
166
- * @return {boolean} Wantassertionssigned
167
- */
168
- public isWantAssertionsSigned(): boolean {
169
- return this.meta.spSSODescriptor.wantAssertionsSigned === 'true';
170
- }
171
- /**
172
- * @desc Get the preference whether it signs request
173
- * @return {boolean} Authnrequestssigned
174
- */
175
- public isAuthnRequestSigned(): boolean {
176
- return this.meta.spSSODescriptor.authnRequestsSigned === 'true';
177
- }
178
- /**
179
- * @desc Get the entity endpoint for assertion consumer service
180
- * @param {string} binding protocol binding (e.g. redirect, post)
181
- * @return {string/[string]} URL of endpoint(s)
182
- */
183
- public getAssertionConsumerService(binding: string): string | string[] {
184
- if (isString(binding)) {
185
- let location;
186
- const bindName = namespace.binding[binding];
187
- if (isNonEmptyArray(this.meta.assertionConsumerService)) {
188
- this.meta.assertionConsumerService.forEach(obj => {
189
- if (obj.binding === bindName) {
190
- location = obj.location;
191
- return;
192
- }
193
- });
194
- } else {
195
- if (this.meta.assertionConsumerService.binding === bindName) {
196
- location = this.meta.assertionConsumerService.location;
197
- }
198
- }
199
- return location;
200
- }
201
- return this.meta.assertionConsumerService;
202
- }
203
- }
package/src/metadata.ts DELETED
@@ -1,166 +0,0 @@
1
- /**
2
- * @file metadata.ts
3
- * @author tngan
4
- * @desc An abstraction for metadata of identity provider and service provider
5
- */
6
- import * as fs from 'fs';
7
- import { namespace } from './urn';
8
- import { extract } from './extractor';
9
- import { isString } from './utility';
10
-
11
- export interface MetadataInterface {
12
- xmlString: string;
13
- getMetadata: () => string;
14
- exportMetadata: (exportFile: string) => void;
15
- getEntityID: () => string;
16
- getX509Certificate: (certType: string) => string | string[];
17
- getNameIDFormat: () => any[];
18
- getSingleLogoutService: (binding: string | undefined) => string | object;
19
- getSupportBindings: (services: string[]) => string[];
20
- }
21
-
22
- export default class Metadata implements MetadataInterface {
23
-
24
- xmlString: string;
25
- meta: any;
26
-
27
- /**
28
- * @param {string | Buffer} xml
29
- * @param {object} extraParse for custom metadata extractor
30
- */
31
- constructor(xml: string | Buffer, extraParse: any = []) {
32
- this.xmlString = xml.toString();
33
- this.meta = extract(this.xmlString, extraParse.concat([
34
- {
35
- key: 'entityDescriptor',
36
- localPath: ['EntityDescriptor'],
37
- attributes: [],
38
- context: true
39
- },
40
- {
41
- key: 'entityID',
42
- localPath: ['EntityDescriptor'],
43
- attributes: ['entityID']
44
- },
45
- {
46
- // shared certificate for both encryption and signing
47
- key: 'sharedCertificate',
48
- localPath: ['EntityDescriptor', '~SSODescriptor', 'KeyDescriptor', 'KeyInfo', 'X509Data', 'X509Certificate'],
49
- attributes: []
50
- },
51
- {
52
- // explicit certificate declaration for encryption and signing
53
- key: 'certificate',
54
- localPath: ['EntityDescriptor', '~SSODescriptor', 'KeyDescriptor'],
55
- index: ['use'],
56
- attributePath: ['KeyInfo', 'X509Data', 'X509Certificate'],
57
- attributes: []
58
- },
59
- {
60
- key: 'singleLogoutService',
61
- localPath: ['EntityDescriptor', '~SSODescriptor', 'SingleLogoutService'],
62
- attributes: ['Binding', 'Location']
63
- },
64
- {
65
- key: 'nameIDFormat',
66
- localPath: ['EntityDescriptor', '~SSODescriptor', 'NameIDFormat'],
67
- attributes: [],
68
- }
69
- ]));
70
-
71
- // get shared certificate
72
- const sharedCertificate = this.meta.sharedCertificate;
73
- if (typeof sharedCertificate === 'string') {
74
- this.meta.certificate = {
75
- signing: sharedCertificate,
76
- encryption: sharedCertificate
77
- };
78
- delete this.meta.sharedCertificate;
79
- }
80
-
81
- if (
82
- Array.isArray(this.meta.entityDescriptor) &&
83
- this.meta.entityDescriptor.length > 1
84
- ) {
85
- throw new Error('ERR_MULTIPLE_METADATA_ENTITYDESCRIPTOR');
86
- }
87
-
88
- }
89
-
90
- /**
91
- * @desc Get the metadata in xml format
92
- * @return {string} metadata in xml format
93
- */
94
- public getMetadata(): string {
95
- return this.xmlString;
96
- }
97
-
98
- /**
99
- * @desc Export the metadata to specific file
100
- * @param {string} exportFile is the output file path
101
- */
102
- public exportMetadata(exportFile: string): void {
103
- fs.writeFileSync(exportFile, this.xmlString);
104
- }
105
-
106
- /**
107
- * @desc Get the entityID in metadata
108
- * @return {string} entityID
109
- */
110
- public getEntityID(): string {
111
- return this.meta.entityID;
112
- }
113
-
114
- /**
115
- * @desc Get the x509 certificate declared in entity metadata
116
- * @param {string} use declares the type of certificate
117
- * @return {string} certificate in string format
118
- */
119
- public getX509Certificate(use: string) {
120
- return this.meta.certificate[use] || null;
121
- }
122
-
123
- /**
124
- * @desc Get the support NameID format declared in entity metadata
125
- * @return {array} support NameID format
126
- */
127
- public getNameIDFormat(): any {
128
- return this.meta.nameIDFormat;
129
- }
130
-
131
- /**
132
- * @desc Get the entity endpoint for single logout service
133
- * @param {string} binding e.g. redirect, post
134
- * @return {string/object} location
135
- */
136
- public getSingleLogoutService(binding: string | undefined): string | object {
137
- if (binding && isString(binding)) {
138
- const bindType = namespace.binding[binding];
139
- let singleLogoutService = this.meta.singleLogoutService;
140
- if (!(singleLogoutService instanceof Array)) {
141
- singleLogoutService = [singleLogoutService];
142
- }
143
- const service = singleLogoutService.find(obj => obj.binding === bindType);
144
- if (service) {
145
- return service.location;
146
- }
147
- }
148
- return this.meta.singleLogoutService;
149
- }
150
-
151
- /**
152
- * @desc Get the support bindings
153
- * @param {[string]} services
154
- * @return {[string]} support bindings
155
- */
156
- public getSupportBindings(services: string[]): string[] {
157
- let supportBindings = [];
158
- if (services) {
159
- supportBindings = services.reduce((acc: any, service) => {
160
- const supportBinding = Object.keys(service)[0];
161
- return acc.push(supportBinding);
162
- }, []);
163
- }
164
- return supportBindings;
165
- }
166
- }
package/src/types.ts DELETED
@@ -1,127 +0,0 @@
1
- import { LoginResponseTemplate } from './libsaml';
2
-
3
- export { IdentityProvider as IdentityProviderConstructor } from './entity-idp';
4
- export { IdpMetadata as IdentityProviderMetadata } from './metadata-idp';
5
-
6
- export { ServiceProvider as ServiceProviderConstructor } from './entity-sp';
7
- export { SpMetadata as ServiceProviderMetadata } from './metadata-sp';
8
-
9
- export type MetadataFile = string | Buffer;
10
-
11
- type SSOService = {
12
- isDefault?: boolean;
13
- Binding: string;
14
- Location: string;
15
- };
16
-
17
- export interface MetadataIdpOptions {
18
- entityID?: string;
19
- signingCert?: string | Buffer | (string | Buffer)[];
20
- encryptCert?: string | Buffer | (string | Buffer)[];
21
- wantAuthnRequestsSigned?: boolean;
22
- nameIDFormat?: string[];
23
- singleSignOnService?: SSOService[];
24
- singleLogoutService?: SSOService[];
25
- requestSignatureAlgorithm?: string;
26
- }
27
-
28
- export type MetadataIdpConstructor =
29
- | MetadataIdpOptions
30
- | MetadataFile;
31
-
32
- export interface MetadataSpOptions {
33
- entityID?: string;
34
- signingCert?: string | Buffer | (string | Buffer)[];
35
- encryptCert?: string | Buffer | (string | Buffer)[];
36
- authnRequestsSigned?: boolean;
37
- wantAssertionsSigned?: boolean;
38
- wantMessageSigned?: boolean;
39
- signatureConfig?: { [key: string]: any };
40
- nameIDFormat?: string[];
41
- singleSignOnService?: SSOService[];
42
- singleLogoutService?: SSOService[];
43
- assertionConsumerService?: SSOService[];
44
- elementsOrder?: string[];
45
- }
46
-
47
- export type MetadataSpConstructor =
48
- | MetadataSpOptions
49
- | MetadataFile;
50
-
51
- export type EntitySetting = ServiceProviderSettings & IdentityProviderSettings;
52
-
53
- export interface SignatureConfig {
54
- prefix?: string;
55
- location?: {
56
- reference?: string;
57
- action?: 'append' | 'prepend' | 'before' | 'after';
58
- };
59
- }
60
-
61
- export interface SAMLDocumentTemplate {
62
- context?: string;
63
- }
64
-
65
- export type ServiceProviderSettings = {
66
- metadata?: string | Buffer;
67
- entityID?: string;
68
- authnRequestsSigned?: boolean;
69
- wantAssertionsSigned?: boolean;
70
- wantMessageSigned?: boolean;
71
- wantLogoutResponseSigned?: boolean;
72
- wantLogoutRequestSigned?: boolean;
73
- privateKey?: string | Buffer;
74
- privateKeyPass?: string;
75
- isAssertionEncrypted?: boolean;
76
- requestSignatureAlgorithm?: string;
77
- encPrivateKey?: string | Buffer;
78
- encPrivateKeyPass?: string | Buffer;
79
- assertionConsumerService?: SSOService[];
80
- singleLogoutService?: SSOService[];
81
- signatureConfig?: SignatureConfig;
82
- loginRequestTemplate?: SAMLDocumentTemplate;
83
- logoutRequestTemplate?: SAMLDocumentTemplate;
84
- signingCert?: string | Buffer | (string | Buffer)[];
85
- encryptCert?: string | Buffer | (string | Buffer)[];
86
- transformationAlgorithms?: string[];
87
- nameIDFormat?: string[];
88
- allowCreate?: boolean;
89
- // will be deprecated soon
90
- relayState?: string;
91
- // https://github.com/tngan/samlify/issues/337
92
- clockDrifts?: [number, number];
93
- };
94
-
95
- export type IdentityProviderSettings = {
96
- metadata?: string | Buffer;
97
-
98
- /** signature algorithm */
99
- requestSignatureAlgorithm?: string;
100
-
101
- /** template of login response */
102
- loginResponseTemplate?: LoginResponseTemplate;
103
-
104
- /** template of logout request */
105
- logoutRequestTemplate?: SAMLDocumentTemplate;
106
-
107
- /** customized function used for generating request ID */
108
- generateID?: () => string;
109
-
110
- entityID?: string;
111
- privateKey?: string | Buffer;
112
- privateKeyPass?: string;
113
- signingCert?: string | Buffer | (string | Buffer)[];
114
- encryptCert?: string | Buffer | (string | Buffer)[];
115
- nameIDFormat?: string[];
116
- singleSignOnService?: SSOService[];
117
- singleLogoutService?: SSOService[];
118
- isAssertionEncrypted?: boolean;
119
- encPrivateKey?: string | Buffer;
120
- encPrivateKeyPass?: string;
121
- messageSigningOrder?: string;
122
- wantLogoutRequestSigned?: boolean;
123
- wantLogoutResponseSigned?: boolean;
124
- wantAuthnRequestsSigned?: boolean;
125
- wantLogoutRequestSignedResponseSigned?: boolean;
126
- tagPrefix?: { [key: string]: string };
127
- };