samlesa 2.12.3 → 2.12.5
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.
Potentially problematic release.
This version of samlesa might be problematic. Click here for more details.
- package/build/.idea/workspace.xml +13 -1
- package/build/index.js +54 -64
- package/build/index.js.map +1 -1
- package/build/src/api.js +24 -23
- package/build/src/api.js.map +1 -1
- package/build/src/binding-post.js +358 -368
- package/build/src/binding-post.js.map +1 -1
- package/build/src/binding-redirect.js +333 -332
- package/build/src/binding-redirect.js.map +1 -1
- package/build/src/binding-simplesign.js +222 -232
- package/build/src/binding-simplesign.js.map +1 -1
- package/build/src/entity-idp.js +130 -130
- package/build/src/entity-idp.js.map +1 -1
- package/build/src/entity-sp.js +96 -96
- package/build/src/entity-sp.js.map +1 -1
- package/build/src/entity.js +225 -235
- package/build/src/entity.js.map +1 -1
- package/build/src/extractor.js +385 -369
- package/build/src/extractor.js.map +1 -1
- package/build/src/flow.js +320 -319
- package/build/src/flow.js.map +1 -1
- package/build/src/libsaml.js +665 -641
- package/build/src/libsaml.js.map +1 -1
- package/build/src/metadata-idp.js +127 -127
- package/build/src/metadata-idp.js.map +1 -1
- package/build/src/metadata-sp.js +231 -231
- package/build/src/metadata-sp.js.map +1 -1
- package/build/src/metadata.js +166 -176
- package/build/src/metadata.js.map +1 -1
- package/build/src/types.js +11 -11
- package/build/src/urn.js +212 -212
- package/build/src/urn.js.map +1 -1
- package/build/src/utility.js +292 -248
- package/build/src/utility.js.map +1 -1
- package/build/src/validator.js +27 -26
- package/build/src/validator.js.map +1 -1
- package/package.json +8 -10
- package/src/api.ts +1 -1
- package/src/binding-redirect.ts +83 -64
- package/src/extractor.ts +23 -5
- package/src/libsaml.ts +95 -62
- package/src/utility.ts +147 -76
- package/types/index.d.ts +10 -10
- package/types/src/api.d.ts +13 -13
- package/types/src/binding-post.d.ts +46 -46
- package/types/src/binding-redirect.d.ts +52 -52
- package/types/src/binding-simplesign.d.ts +39 -39
- package/types/src/entity-idp.d.ts +42 -42
- package/types/src/entity-sp.d.ts +36 -36
- package/types/src/entity.d.ts +101 -99
- package/types/src/extractor.d.ts +25 -25
- package/types/src/flow.d.ts +6 -6
- package/types/src/libsaml.d.ts +200 -210
- package/types/src/metadata-idp.d.ts +24 -24
- package/types/src/metadata-sp.d.ts +36 -36
- package/types/src/metadata.d.ts +59 -57
- package/types/src/types.d.ts +129 -127
- package/types/src/urn.d.ts +194 -194
- package/types/src/utility.d.ts +134 -134
- package/types/src/validator.d.ts +3 -3
|
@@ -1,46 +1,46 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @file binding-post.ts
|
|
3
|
-
* @author tngan
|
|
4
|
-
* @desc Binding-level API, declare the functions using POST binding
|
|
5
|
-
*/
|
|
6
|
-
import { BindingContext } from './entity.js';
|
|
7
|
-
/**
|
|
8
|
-
* @desc Generate a base64 encoded login request
|
|
9
|
-
* @param {string} referenceTagXPath reference uri
|
|
10
|
-
* @param {object} entity object includes both idp and sp
|
|
11
|
-
* @param {function} customTagReplacement used when developers have their own login response template
|
|
12
|
-
*/
|
|
13
|
-
declare function base64LoginRequest(referenceTagXPath: string, entity: any, customTagReplacement?: (template: string) => BindingContext): BindingContext;
|
|
14
|
-
/**
|
|
15
|
-
* @desc Generate a base64 encoded login response
|
|
16
|
-
* @param {object} requestInfo corresponding request, used to obtain the id
|
|
17
|
-
* @param {object} entity object includes both idp and sp
|
|
18
|
-
* @param {object} user current logged user (e.g. req.user)
|
|
19
|
-
* @param {function} customTagReplacement used when developers have their own login response template
|
|
20
|
-
* @param {boolean} encryptThenSign whether or not to encrypt then sign first (if signing). Defaults to sign-then-encrypt
|
|
21
|
-
*/
|
|
22
|
-
declare function base64LoginResponse(requestInfo: any
|
|
23
|
-
/**
|
|
24
|
-
* @desc Generate a base64 encoded logout request
|
|
25
|
-
* @param {object} user current logged user (e.g. req.user)
|
|
26
|
-
* @param {string} referenceTagXPath reference uri
|
|
27
|
-
* @param {object} entity object includes both idp and sp
|
|
28
|
-
* @param {function} customTagReplacement used when developers have their own login response template
|
|
29
|
-
* @return {string} base64 encoded request
|
|
30
|
-
*/
|
|
31
|
-
declare function base64LogoutRequest(user: any, referenceTagXPath: any, entity: any, customTagReplacement?: (template: string) => BindingContext): BindingContext;
|
|
32
|
-
/**
|
|
33
|
-
* @desc Generate a base64 encoded logout response
|
|
34
|
-
* @param {object} requestInfo corresponding request, used to obtain the id
|
|
35
|
-
* @param {string} referenceTagXPath reference uri
|
|
36
|
-
* @param {object} entity object includes both idp and sp
|
|
37
|
-
* @param {function} customTagReplacement used when developers have their own login response template
|
|
38
|
-
*/
|
|
39
|
-
declare function base64LogoutResponse(requestInfo: any, entity: any, customTagReplacement: (template: string) => BindingContext): BindingContext;
|
|
40
|
-
declare const postBinding: {
|
|
41
|
-
base64LoginRequest: typeof base64LoginRequest;
|
|
42
|
-
base64LoginResponse: typeof base64LoginResponse;
|
|
43
|
-
base64LogoutRequest: typeof base64LogoutRequest;
|
|
44
|
-
base64LogoutResponse: typeof base64LogoutResponse;
|
|
45
|
-
};
|
|
46
|
-
export default postBinding;
|
|
1
|
+
/**
|
|
2
|
+
* @file binding-post.ts
|
|
3
|
+
* @author tngan
|
|
4
|
+
* @desc Binding-level API, declare the functions using POST binding
|
|
5
|
+
*/
|
|
6
|
+
import { BindingContext } from './entity.js';
|
|
7
|
+
/**
|
|
8
|
+
* @desc Generate a base64 encoded login request
|
|
9
|
+
* @param {string} referenceTagXPath reference uri
|
|
10
|
+
* @param {object} entity object includes both idp and sp
|
|
11
|
+
* @param {function} customTagReplacement used when developers have their own login response template
|
|
12
|
+
*/
|
|
13
|
+
declare function base64LoginRequest(referenceTagXPath: string, entity: any, customTagReplacement?: (template: string) => BindingContext): BindingContext;
|
|
14
|
+
/**
|
|
15
|
+
* @desc Generate a base64 encoded login response
|
|
16
|
+
* @param {object} requestInfo corresponding request, used to obtain the id
|
|
17
|
+
* @param {object} entity object includes both idp and sp
|
|
18
|
+
* @param {object} user current logged user (e.g. req.user)
|
|
19
|
+
* @param {function} customTagReplacement used when developers have their own login response template
|
|
20
|
+
* @param {boolean} encryptThenSign whether or not to encrypt then sign first (if signing). Defaults to sign-then-encrypt
|
|
21
|
+
*/
|
|
22
|
+
declare function base64LoginResponse(requestInfo: any, entity: any, user?: any, customTagReplacement?: (template: string) => BindingContext, encryptThenSign?: boolean): Promise<BindingContext>;
|
|
23
|
+
/**
|
|
24
|
+
* @desc Generate a base64 encoded logout request
|
|
25
|
+
* @param {object} user current logged user (e.g. req.user)
|
|
26
|
+
* @param {string} referenceTagXPath reference uri
|
|
27
|
+
* @param {object} entity object includes both idp and sp
|
|
28
|
+
* @param {function} customTagReplacement used when developers have their own login response template
|
|
29
|
+
* @return {string} base64 encoded request
|
|
30
|
+
*/
|
|
31
|
+
declare function base64LogoutRequest(user: any, referenceTagXPath: any, entity: any, customTagReplacement?: (template: string) => BindingContext): BindingContext;
|
|
32
|
+
/**
|
|
33
|
+
* @desc Generate a base64 encoded logout response
|
|
34
|
+
* @param {object} requestInfo corresponding request, used to obtain the id
|
|
35
|
+
* @param {string} referenceTagXPath reference uri
|
|
36
|
+
* @param {object} entity object includes both idp and sp
|
|
37
|
+
* @param {function} customTagReplacement used when developers have their own login response template
|
|
38
|
+
*/
|
|
39
|
+
declare function base64LogoutResponse(requestInfo: any, entity: any, customTagReplacement: (template: string) => BindingContext): BindingContext;
|
|
40
|
+
declare const postBinding: {
|
|
41
|
+
base64LoginRequest: typeof base64LoginRequest;
|
|
42
|
+
base64LoginResponse: typeof base64LoginResponse;
|
|
43
|
+
base64LogoutRequest: typeof base64LogoutRequest;
|
|
44
|
+
base64LogoutResponse: typeof base64LogoutResponse;
|
|
45
|
+
};
|
|
46
|
+
export default postBinding;
|
|
@@ -1,52 +1,52 @@
|
|
|
1
|
-
import { BindingContext } from './entity.js';
|
|
2
|
-
import { IdentityProvider as Idp } from './entity-idp.js';
|
|
3
|
-
import { ServiceProvider as Sp } from './entity-sp.js';
|
|
4
|
-
export interface BuildRedirectConfig {
|
|
5
|
-
baseUrl: string;
|
|
6
|
-
type: string;
|
|
7
|
-
isSigned: boolean;
|
|
8
|
-
context: string;
|
|
9
|
-
entitySetting: any;
|
|
10
|
-
relayState?: string;
|
|
11
|
-
}
|
|
12
|
-
/**
|
|
13
|
-
* @desc Redirect URL for login request
|
|
14
|
-
* @param {object} entity object includes both idp and sp
|
|
15
|
-
* @param {function} customTagReplacement used when developers have their own login response template
|
|
16
|
-
* @return {string} redirect URL
|
|
17
|
-
*/
|
|
18
|
-
declare function loginRequestRedirectURL(entity: {
|
|
19
|
-
idp: Idp;
|
|
20
|
-
sp: Sp;
|
|
21
|
-
}, customTagReplacement?: (template: string) => BindingContext): BindingContext;
|
|
22
|
-
/**
|
|
23
|
-
* @desc Redirect URL for login response
|
|
24
|
-
* @param {object} requestInfo corresponding request, used to obtain the id
|
|
25
|
-
* @param {object} entity object includes both idp and sp
|
|
26
|
-
* @param {object} user current logged user (e.g. req.user)
|
|
27
|
-
* @param {String} relayState the relaystate sent by sp corresponding request
|
|
28
|
-
* @param {function} customTagReplacement used when developers have their own login response template
|
|
29
|
-
*/
|
|
30
|
-
declare function loginResponseRedirectURL(requestInfo: any, entity: any, user?: any, relayState?: string, customTagReplacement?: (template: string) => BindingContext): BindingContext;
|
|
31
|
-
/**
|
|
32
|
-
* @desc Redirect URL for logout request
|
|
33
|
-
* @param {object} user current logged user (e.g. req.user)
|
|
34
|
-
* @param {object} entity object includes both idp and sp
|
|
35
|
-
* @param {function} customTagReplacement used when developers have their own login response template
|
|
36
|
-
* @return {string} redirect URL
|
|
37
|
-
*/
|
|
38
|
-
declare function logoutRequestRedirectURL(user: any, entity: any, relayState?: string, customTagReplacement?: (template: string, tags: object) => BindingContext): BindingContext;
|
|
39
|
-
/**
|
|
40
|
-
* @desc Redirect URL for logout response
|
|
41
|
-
* @param {object} requescorresponding request, used to obtain the id
|
|
42
|
-
* @param {object} entity object includes both idp and sp
|
|
43
|
-
* @param {function} customTagReplacement used when developers have their own login response template
|
|
44
|
-
*/
|
|
45
|
-
declare function logoutResponseRedirectURL(requestInfo: any, entity: any, relayState?: string, customTagReplacement?: (template: string) => BindingContext): BindingContext;
|
|
46
|
-
declare const redirectBinding: {
|
|
47
|
-
loginRequestRedirectURL: typeof loginRequestRedirectURL;
|
|
48
|
-
loginResponseRedirectURL: typeof loginResponseRedirectURL;
|
|
49
|
-
logoutRequestRedirectURL: typeof logoutRequestRedirectURL;
|
|
50
|
-
logoutResponseRedirectURL: typeof logoutResponseRedirectURL;
|
|
51
|
-
};
|
|
52
|
-
export default redirectBinding;
|
|
1
|
+
import { BindingContext } from './entity.js';
|
|
2
|
+
import { IdentityProvider as Idp } from './entity-idp.js';
|
|
3
|
+
import { ServiceProvider as Sp } from './entity-sp.js';
|
|
4
|
+
export interface BuildRedirectConfig {
|
|
5
|
+
baseUrl: string;
|
|
6
|
+
type: string;
|
|
7
|
+
isSigned: boolean;
|
|
8
|
+
context: string;
|
|
9
|
+
entitySetting: any;
|
|
10
|
+
relayState?: string;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* @desc Redirect URL for login request
|
|
14
|
+
* @param {object} entity object includes both idp and sp
|
|
15
|
+
* @param {function} customTagReplacement used when developers have their own login response template
|
|
16
|
+
* @return {string} redirect URL
|
|
17
|
+
*/
|
|
18
|
+
declare function loginRequestRedirectURL(entity: {
|
|
19
|
+
idp: Idp;
|
|
20
|
+
sp: Sp;
|
|
21
|
+
}, customTagReplacement?: (template: string) => BindingContext): BindingContext;
|
|
22
|
+
/**
|
|
23
|
+
* @desc Redirect URL for login response
|
|
24
|
+
* @param {object} requestInfo corresponding request, used to obtain the id
|
|
25
|
+
* @param {object} entity object includes both idp and sp
|
|
26
|
+
* @param {object} user current logged user (e.g. req.user)
|
|
27
|
+
* @param {String} relayState the relaystate sent by sp corresponding request
|
|
28
|
+
* @param {function} customTagReplacement used when developers have their own login response template
|
|
29
|
+
*/
|
|
30
|
+
declare function loginResponseRedirectURL(requestInfo: any, entity: any, user?: any, relayState?: string, customTagReplacement?: (template: string) => BindingContext): BindingContext;
|
|
31
|
+
/**
|
|
32
|
+
* @desc Redirect URL for logout request
|
|
33
|
+
* @param {object} user current logged user (e.g. req.user)
|
|
34
|
+
* @param {object} entity object includes both idp and sp
|
|
35
|
+
* @param {function} customTagReplacement used when developers have their own login response template
|
|
36
|
+
* @return {string} redirect URL
|
|
37
|
+
*/
|
|
38
|
+
declare function logoutRequestRedirectURL(user: any, entity: any, relayState?: string, customTagReplacement?: (template: string, tags: object) => BindingContext): BindingContext;
|
|
39
|
+
/**
|
|
40
|
+
* @desc Redirect URL for logout response
|
|
41
|
+
* @param {object} requescorresponding request, used to obtain the id
|
|
42
|
+
* @param {object} entity object includes both idp and sp
|
|
43
|
+
* @param {function} customTagReplacement used when developers have their own login response template
|
|
44
|
+
*/
|
|
45
|
+
declare function logoutResponseRedirectURL(requestInfo: any, entity: any, relayState?: string, customTagReplacement?: (template: string) => BindingContext): BindingContext;
|
|
46
|
+
declare const redirectBinding: {
|
|
47
|
+
loginRequestRedirectURL: typeof loginRequestRedirectURL;
|
|
48
|
+
loginResponseRedirectURL: typeof loginResponseRedirectURL;
|
|
49
|
+
logoutRequestRedirectURL: typeof logoutRequestRedirectURL;
|
|
50
|
+
logoutResponseRedirectURL: typeof logoutResponseRedirectURL;
|
|
51
|
+
};
|
|
52
|
+
export default redirectBinding;
|
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @file binding-simplesign.ts
|
|
3
|
-
* @author Orange
|
|
4
|
-
* @desc Binding-level API, declare the functions using POST SimpleSign binding
|
|
5
|
-
*/
|
|
6
|
-
import { BindingContext, SimpleSignComputedContext } from './entity.js';
|
|
7
|
-
export interface BuildSimpleSignConfig {
|
|
8
|
-
type: string;
|
|
9
|
-
context: string;
|
|
10
|
-
entitySetting: any;
|
|
11
|
-
relayState?: string;
|
|
12
|
-
}
|
|
13
|
-
export interface BindingSimpleSignContext {
|
|
14
|
-
id: string;
|
|
15
|
-
context: string;
|
|
16
|
-
signature: any;
|
|
17
|
-
sigAlg: string;
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* @desc Generate a base64 encoded login request
|
|
21
|
-
* @param {string} referenceTagXPath reference uri
|
|
22
|
-
* @param {object} entity object includes both idp and sp
|
|
23
|
-
* @param {function} customTagReplacement used when developers have their own login response template
|
|
24
|
-
*/
|
|
25
|
-
declare function base64LoginRequest(entity: any, customTagReplacement?: (template: string) => BindingContext): SimpleSignComputedContext;
|
|
26
|
-
/**
|
|
27
|
-
* @desc Generate a base64 encoded login response
|
|
28
|
-
* @param {object} requestInfo corresponding request, used to obtain the id
|
|
29
|
-
* @param {object} entity object includes both idp and sp
|
|
30
|
-
* @param {object} user current logged user (e.g. req.user)
|
|
31
|
-
* @param {string} relayState the relay state
|
|
32
|
-
* @param {function} customTagReplacement used when developers have their own login response template
|
|
33
|
-
*/
|
|
34
|
-
declare function base64LoginResponse(requestInfo: any
|
|
35
|
-
declare const simpleSignBinding: {
|
|
36
|
-
base64LoginRequest: typeof base64LoginRequest;
|
|
37
|
-
base64LoginResponse: typeof base64LoginResponse;
|
|
38
|
-
};
|
|
39
|
-
export default simpleSignBinding;
|
|
1
|
+
/**
|
|
2
|
+
* @file binding-simplesign.ts
|
|
3
|
+
* @author Orange
|
|
4
|
+
* @desc Binding-level API, declare the functions using POST SimpleSign binding
|
|
5
|
+
*/
|
|
6
|
+
import { BindingContext, SimpleSignComputedContext } from './entity.js';
|
|
7
|
+
export interface BuildSimpleSignConfig {
|
|
8
|
+
type: string;
|
|
9
|
+
context: string;
|
|
10
|
+
entitySetting: any;
|
|
11
|
+
relayState?: string;
|
|
12
|
+
}
|
|
13
|
+
export interface BindingSimpleSignContext {
|
|
14
|
+
id: string;
|
|
15
|
+
context: string;
|
|
16
|
+
signature: any;
|
|
17
|
+
sigAlg: string;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* @desc Generate a base64 encoded login request
|
|
21
|
+
* @param {string} referenceTagXPath reference uri
|
|
22
|
+
* @param {object} entity object includes both idp and sp
|
|
23
|
+
* @param {function} customTagReplacement used when developers have their own login response template
|
|
24
|
+
*/
|
|
25
|
+
declare function base64LoginRequest(entity: any, customTagReplacement?: (template: string) => BindingContext): SimpleSignComputedContext;
|
|
26
|
+
/**
|
|
27
|
+
* @desc Generate a base64 encoded login response
|
|
28
|
+
* @param {object} requestInfo corresponding request, used to obtain the id
|
|
29
|
+
* @param {object} entity object includes both idp and sp
|
|
30
|
+
* @param {object} user current logged user (e.g. req.user)
|
|
31
|
+
* @param {string} relayState the relay state
|
|
32
|
+
* @param {function} customTagReplacement used when developers have their own login response template
|
|
33
|
+
*/
|
|
34
|
+
declare function base64LoginResponse(requestInfo: any, entity: any, user?: any, relayState?: string, customTagReplacement?: (template: string) => BindingContext): Promise<BindingSimpleSignContext>;
|
|
35
|
+
declare const simpleSignBinding: {
|
|
36
|
+
base64LoginRequest: typeof base64LoginRequest;
|
|
37
|
+
base64LoginResponse: typeof base64LoginResponse;
|
|
38
|
+
};
|
|
39
|
+
export default simpleSignBinding;
|
|
@@ -1,42 +1,42 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @file entity-idp.ts
|
|
3
|
-
* @author tngan
|
|
4
|
-
* @desc Declares the actions taken by identity provider
|
|
5
|
-
*/
|
|
6
|
-
import Entity, { ESamlHttpRequest } from './entity.js';
|
|
7
|
-
import { ServiceProviderConstructor as ServiceProvider, IdentityProviderMetadata, IdentityProviderSettings } from './types.js';
|
|
8
|
-
import { FlowResult } from './flow.js';
|
|
9
|
-
import { BindingContext } from './entity.js';
|
|
10
|
-
/**
|
|
11
|
-
* Identity provider can be configured using either metadata importing or idpSetting
|
|
12
|
-
*/
|
|
13
|
-
export default function (props: IdentityProviderSettings): IdentityProvider;
|
|
14
|
-
/**
|
|
15
|
-
* Identity provider can be configured using either metadata importing or idpSetting
|
|
16
|
-
*/
|
|
17
|
-
export declare class IdentityProvider extends Entity {
|
|
18
|
-
entityMeta: IdentityProviderMetadata;
|
|
19
|
-
constructor(idpSetting: IdentityProviderSettings);
|
|
20
|
-
/**
|
|
21
|
-
* @desc Generates the login response for developers to design their own method
|
|
22
|
-
* @param sp object of service provider
|
|
23
|
-
* @param requestInfo corresponding request, used to obtain the id
|
|
24
|
-
* @param binding protocol binding
|
|
25
|
-
* @param user current logged user (e.g. req.user)
|
|
26
|
-
* @param customTagReplacement used when developers have their own login response template
|
|
27
|
-
* @param encryptThenSign whether or not to encrypt then sign first (if signing)
|
|
28
|
-
* @param relayState the relayState from corresponding request
|
|
29
|
-
*/
|
|
30
|
-
createLoginResponse(sp: ServiceProvider, requestInfo: {
|
|
31
|
-
[key: string]: any;
|
|
32
|
-
}, binding: string, user: {
|
|
33
|
-
[key: string]: any;
|
|
34
|
-
}, customTagReplacement?: (template: string) => BindingContext, encryptThenSign?: boolean, relayState?: string): Promise<any>;
|
|
35
|
-
/**
|
|
36
|
-
* Validation of the parsed URL parameters
|
|
37
|
-
* @param sp ServiceProvider instance
|
|
38
|
-
* @param binding Protocol binding
|
|
39
|
-
* @param req RequesmessageSigningOrderst
|
|
40
|
-
*/
|
|
41
|
-
parseLoginRequest(sp: ServiceProvider, binding: string, req: ESamlHttpRequest): Promise<FlowResult>;
|
|
42
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* @file entity-idp.ts
|
|
3
|
+
* @author tngan
|
|
4
|
+
* @desc Declares the actions taken by identity provider
|
|
5
|
+
*/
|
|
6
|
+
import Entity, { ESamlHttpRequest } from './entity.js';
|
|
7
|
+
import { ServiceProviderConstructor as ServiceProvider, IdentityProviderMetadata, IdentityProviderSettings } from './types.js';
|
|
8
|
+
import { FlowResult } from './flow.js';
|
|
9
|
+
import { BindingContext } from './entity.js';
|
|
10
|
+
/**
|
|
11
|
+
* Identity provider can be configured using either metadata importing or idpSetting
|
|
12
|
+
*/
|
|
13
|
+
export default function (props: IdentityProviderSettings): IdentityProvider;
|
|
14
|
+
/**
|
|
15
|
+
* Identity provider can be configured using either metadata importing or idpSetting
|
|
16
|
+
*/
|
|
17
|
+
export declare class IdentityProvider extends Entity {
|
|
18
|
+
entityMeta: IdentityProviderMetadata;
|
|
19
|
+
constructor(idpSetting: IdentityProviderSettings);
|
|
20
|
+
/**
|
|
21
|
+
* @desc Generates the login response for developers to design their own method
|
|
22
|
+
* @param sp object of service provider
|
|
23
|
+
* @param requestInfo corresponding request, used to obtain the id
|
|
24
|
+
* @param binding protocol binding
|
|
25
|
+
* @param user current logged user (e.g. req.user)
|
|
26
|
+
* @param customTagReplacement used when developers have their own login response template
|
|
27
|
+
* @param encryptThenSign whether or not to encrypt then sign first (if signing)
|
|
28
|
+
* @param relayState the relayState from corresponding request
|
|
29
|
+
*/
|
|
30
|
+
createLoginResponse(sp: ServiceProvider, requestInfo: {
|
|
31
|
+
[key: string]: any;
|
|
32
|
+
}, binding: string, user: {
|
|
33
|
+
[key: string]: any;
|
|
34
|
+
}, customTagReplacement?: (template: string) => BindingContext, encryptThenSign?: boolean, relayState?: string): Promise<any>;
|
|
35
|
+
/**
|
|
36
|
+
* Validation of the parsed URL parameters
|
|
37
|
+
* @param sp ServiceProvider instance
|
|
38
|
+
* @param binding Protocol binding
|
|
39
|
+
* @param req RequesmessageSigningOrderst
|
|
40
|
+
*/
|
|
41
|
+
parseLoginRequest(sp: ServiceProvider, binding: string, req: ESamlHttpRequest): Promise<FlowResult>;
|
|
42
|
+
}
|
package/types/src/entity-sp.d.ts
CHANGED
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @file entity-sp.ts
|
|
3
|
-
* @author tngan
|
|
4
|
-
* @desc Declares the actions taken by service provider
|
|
5
|
-
*/
|
|
6
|
-
import Entity, { BindingContext, PostBindingContext, ESamlHttpRequest, SimpleSignBindingContext } from './entity.js';
|
|
7
|
-
import { IdentityProviderConstructor as IdentityProvider, ServiceProviderMetadata, ServiceProviderSettings } from './types.js';
|
|
8
|
-
import { FlowResult } from './flow.js';
|
|
9
|
-
export default function (props: ServiceProviderSettings): ServiceProvider;
|
|
10
|
-
/**
|
|
11
|
-
* @desc Service provider can be configured using either metadata importing or spSetting
|
|
12
|
-
* @param {object} spSettingimport { FlowResult } from '../types/src/flow.d';
|
|
13
|
-
|
|
14
|
-
*/
|
|
15
|
-
export declare class ServiceProvider extends Entity {
|
|
16
|
-
entityMeta: ServiceProviderMetadata;
|
|
17
|
-
/**
|
|
18
|
-
* @desc Inherited from Entity
|
|
19
|
-
* @param {object} spSetting setting of service provider
|
|
20
|
-
*/
|
|
21
|
-
constructor(spSetting: ServiceProviderSettings);
|
|
22
|
-
/**
|
|
23
|
-
* @desc Generates the login request for developers to design their own method
|
|
24
|
-
* @param {IdentityProvider} idp object of identity provider
|
|
25
|
-
* @param {string} binding protocol binding
|
|
26
|
-
* @param {function} customTagReplacement used when developers have their own login response template
|
|
27
|
-
*/
|
|
28
|
-
createLoginRequest(idp: IdentityProvider, binding?: string, customTagReplacement?: (template: string) => BindingContext): BindingContext | PostBindingContext | SimpleSignBindingContext;
|
|
29
|
-
/**
|
|
30
|
-
* @desc Validation of the parsed the URL parameters
|
|
31
|
-
* @param {IdentityProvider} idp object of identity provider
|
|
32
|
-
* @param {string} binding protocol binding
|
|
33
|
-
* @param {request} req request
|
|
34
|
-
*/
|
|
35
|
-
parseLoginResponse(idp: any, binding: any, request: ESamlHttpRequest): Promise<FlowResult>;
|
|
36
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* @file entity-sp.ts
|
|
3
|
+
* @author tngan
|
|
4
|
+
* @desc Declares the actions taken by service provider
|
|
5
|
+
*/
|
|
6
|
+
import Entity, { BindingContext, PostBindingContext, ESamlHttpRequest, SimpleSignBindingContext } from './entity.js';
|
|
7
|
+
import { IdentityProviderConstructor as IdentityProvider, ServiceProviderMetadata, ServiceProviderSettings } from './types.js';
|
|
8
|
+
import { FlowResult } from './flow.js';
|
|
9
|
+
export default function (props: ServiceProviderSettings): ServiceProvider;
|
|
10
|
+
/**
|
|
11
|
+
* @desc Service provider can be configured using either metadata importing or spSetting
|
|
12
|
+
* @param {object} spSettingimport { FlowResult } from '../types/src/flow.d';
|
|
13
|
+
|
|
14
|
+
*/
|
|
15
|
+
export declare class ServiceProvider extends Entity {
|
|
16
|
+
entityMeta: ServiceProviderMetadata;
|
|
17
|
+
/**
|
|
18
|
+
* @desc Inherited from Entity
|
|
19
|
+
* @param {object} spSetting setting of service provider
|
|
20
|
+
*/
|
|
21
|
+
constructor(spSetting: ServiceProviderSettings);
|
|
22
|
+
/**
|
|
23
|
+
* @desc Generates the login request for developers to design their own method
|
|
24
|
+
* @param {IdentityProvider} idp object of identity provider
|
|
25
|
+
* @param {string} binding protocol binding
|
|
26
|
+
* @param {function} customTagReplacement used when developers have their own login response template
|
|
27
|
+
*/
|
|
28
|
+
createLoginRequest(idp: IdentityProvider, binding?: string, customTagReplacement?: (template: string) => BindingContext): BindingContext | PostBindingContext | SimpleSignBindingContext;
|
|
29
|
+
/**
|
|
30
|
+
* @desc Validation of the parsed the URL parameters
|
|
31
|
+
* @param {IdentityProvider} idp object of identity provider
|
|
32
|
+
* @param {string} binding protocol binding
|
|
33
|
+
* @param {request} req request
|
|
34
|
+
*/
|
|
35
|
+
parseLoginResponse(idp: any, binding: any, request: ESamlHttpRequest): Promise<FlowResult>;
|
|
36
|
+
}
|