samlesa 3.2.2 → 3.3.1
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.
- package/build/src/binding-post.js +9 -0
- package/build/src/entity.js +10 -12
- package/build/src/extractor.js +275 -283
- package/build/src/flow.js +10 -1
- package/build/src/libsaml.js +2 -46
- package/build/src/urn.js +78 -15
- package/package.json +1 -1
- package/types/src/binding-post.d.ts.map +1 -1
- package/types/src/binding-redirect.d.ts.map +1 -1
- package/types/src/entity.d.ts +11 -8
- package/types/src/entity.d.ts.map +1 -1
- package/types/src/extractor.d.ts +14 -40
- package/types/src/extractor.d.ts.map +1 -1
- package/types/src/flow.d.ts.map +1 -1
- package/types/src/libsaml.d.ts +0 -9
- package/types/src/libsaml.d.ts.map +1 -1
- package/types/src/urn.d.ts +48 -14
- package/types/src/urn.d.ts.map +1 -1
|
@@ -314,7 +314,14 @@ function base64LogoutResponse(requestInfo, entity, customTagReplacement) {
|
|
|
314
314
|
const initSetting = entity.init.entitySetting;
|
|
315
315
|
if (metadata && metadata.init && metadata.target) {
|
|
316
316
|
let rawSamlResponse;
|
|
317
|
+
console.log("这是一个关卡");
|
|
318
|
+
console.log("这是一个关卡");
|
|
319
|
+
console.log("这是一个关卡");
|
|
320
|
+
console.log("这是一个关卡");
|
|
321
|
+
console.log(initSetting.logoutResponseTemplate);
|
|
317
322
|
if (initSetting.logoutResponseTemplate) {
|
|
323
|
+
console.log(initSetting.logoutResponseTemplate?.context);
|
|
324
|
+
console.log('走这里来了===');
|
|
318
325
|
const template = customTagReplacement(initSetting.logoutResponseTemplate.context);
|
|
319
326
|
id = template.id;
|
|
320
327
|
rawSamlResponse = template.context;
|
|
@@ -332,6 +339,8 @@ function base64LogoutResponse(requestInfo, entity, customTagReplacement) {
|
|
|
332
339
|
};
|
|
333
340
|
rawSamlResponse = libsaml.replaceTagsByValue(libsaml.defaultLogoutResponseTemplate.context, tvalue);
|
|
334
341
|
}
|
|
342
|
+
console.log(entity.target.entitySetting);
|
|
343
|
+
console.log("终极设置=====");
|
|
335
344
|
if (entity.target.entitySetting.wantLogoutResponseSigned) {
|
|
336
345
|
const { privateKey, privateKeyPass, requestSignatureAlgorithm: signatureAlgorithm, transformationAlgorithms } = initSetting;
|
|
337
346
|
return {
|
package/build/src/entity.js
CHANGED
|
@@ -123,30 +123,28 @@ export default class Entity {
|
|
|
123
123
|
throw new Error('ERR_UNDEFINED_BINDING');
|
|
124
124
|
}
|
|
125
125
|
/**
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
createLogoutResponse(target, requestInfo, binding, relayState = '', customTagReplacement) {
|
|
134
|
-
const protocol = namespace.binding[binding];
|
|
126
|
+
* @desc Generates the logout response for developers to design their own method
|
|
127
|
+
* @param params
|
|
128
|
+
*/
|
|
129
|
+
async createLogoutResponse(params) {
|
|
130
|
+
const bindType = params?.binding ?? 'post';
|
|
131
|
+
const { sp, requestInfo = {}, customTagReplacement, relayState = '', } = params;
|
|
132
|
+
const protocol = namespace.binding[bindType];
|
|
135
133
|
if (protocol === namespace.binding.redirect) {
|
|
136
134
|
return redirectBinding.logoutResponseRedirectURL(requestInfo, {
|
|
137
135
|
init: this,
|
|
138
|
-
target,
|
|
136
|
+
target: sp,
|
|
139
137
|
}, relayState, customTagReplacement);
|
|
140
138
|
}
|
|
141
139
|
if (protocol === namespace.binding.post) {
|
|
142
140
|
const context = postBinding.base64LogoutResponse(requestInfo, {
|
|
143
141
|
init: this,
|
|
144
|
-
target,
|
|
142
|
+
target: sp,
|
|
145
143
|
}, customTagReplacement);
|
|
146
144
|
return {
|
|
147
145
|
...context,
|
|
148
146
|
relayState,
|
|
149
|
-
entityEndpoint:
|
|
147
|
+
entityEndpoint: sp.entityMeta.getSingleLogoutService(bindType),
|
|
150
148
|
type: 'SAMLResponse',
|
|
151
149
|
};
|
|
152
150
|
}
|