@tachybase/plugin-auth-saml 0.23.8
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/.turbo/turbo-build.log +14 -0
- package/README.md +11 -0
- package/README.zh-CN.md +55 -0
- package/client.d.ts +2 -0
- package/client.js +1 -0
- package/dist/client/Options.d.ts +2 -0
- package/dist/client/SAMLButton.d.ts +5 -0
- package/dist/client/index.d.ts +5 -0
- package/dist/client/index.js +3 -0
- package/dist/client/locale/index.d.ts +3 -0
- package/dist/client/schemas/saml.d.ts +35 -0
- package/dist/constants.d.ts +2 -0
- package/dist/constants.js +31 -0
- package/dist/externalVersion.js +14 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +39 -0
- package/dist/locale/en-US.json +26 -0
- package/dist/locale/es-ES.json +22 -0
- package/dist/locale/fr-FR.json +22 -0
- package/dist/locale/ko_KR.json +29 -0
- package/dist/locale/pt-BR.json +22 -0
- package/dist/locale/zh-CN.json +29 -0
- package/dist/node_modules/@node-saml/node-saml/LICENSE +23 -0
- package/dist/node_modules/@node-saml/node-saml/lib/algorithms.d.ts +5 -0
- package/dist/node_modules/@node-saml/node-saml/lib/algorithms.js +41 -0
- package/dist/node_modules/@node-saml/node-saml/lib/crypto.d.ts +5 -0
- package/dist/node_modules/@node-saml/node-saml/lib/crypto.js +48 -0
- package/dist/node_modules/@node-saml/node-saml/lib/datetime.d.ts +13 -0
- package/dist/node_modules/@node-saml/node-saml/lib/datetime.js +27 -0
- package/dist/node_modules/@node-saml/node-saml/lib/index.d.ts +3 -0
- package/dist/node_modules/@node-saml/node-saml/lib/index.js +9 -0
- package/dist/node_modules/@node-saml/node-saml/lib/inmemory-cache-provider.d.ts +38 -0
- package/dist/node_modules/@node-saml/node-saml/lib/inmemory-cache-provider.js +100 -0
- package/dist/node_modules/@node-saml/node-saml/lib/metadata.d.ts +2 -0
- package/dist/node_modules/@node-saml/node-saml/lib/metadata.js +112 -0
- package/dist/node_modules/@node-saml/node-saml/lib/passport-saml-types.d.ts +8 -0
- package/dist/node_modules/@node-saml/node-saml/lib/passport-saml-types.js +3 -0
- package/dist/node_modules/@node-saml/node-saml/lib/saml-post-signing.d.ts +3 -0
- package/dist/node_modules/@node-saml/node-saml/lib/saml-post-signing.js +15 -0
- package/dist/node_modules/@node-saml/node-saml/lib/saml.d.ts +75 -0
- package/dist/node_modules/@node-saml/node-saml/lib/saml.js +1005 -0
- package/dist/node_modules/@node-saml/node-saml/lib/types.d.ts +219 -0
- package/dist/node_modules/@node-saml/node-saml/lib/types.js +21 -0
- package/dist/node_modules/@node-saml/node-saml/lib/utility.d.ts +5 -0
- package/dist/node_modules/@node-saml/node-saml/lib/utility.js +27 -0
- package/dist/node_modules/@node-saml/node-saml/lib/xml.d.ts +26 -0
- package/dist/node_modules/@node-saml/node-saml/lib/xml.js +234 -0
- package/dist/node_modules/@node-saml/node-saml/package.json +1 -0
- package/dist/server/actions/getAuthUrl.d.ts +2 -0
- package/dist/server/actions/getAuthUrl.js +35 -0
- package/dist/server/actions/metadata.d.ts +2 -0
- package/dist/server/actions/metadata.js +36 -0
- package/dist/server/actions/redirect.d.ts +2 -0
- package/dist/server/actions/redirect.js +49 -0
- package/dist/server/index.d.ts +1 -0
- package/dist/server/index.js +33 -0
- package/dist/server/migrations/20231008112900-update-autosignup.d.ts +6 -0
- package/dist/server/migrations/20231008112900-update-autosignup.js +52 -0
- package/dist/server/plugin.d.ts +11 -0
- package/dist/server/plugin.js +70 -0
- package/dist/server/saml-auth.d.ts +8 -0
- package/dist/server/saml-auth.js +110 -0
- package/dist/swagger/index.d.ts +137 -0
- package/dist/swagger/index.js +163 -0
- package/package.json +35 -0
- package/server.d.ts +2 -0
- package/server.js +1 -0
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
> @tachybase/plugin-auth-saml@0.23.2 build /Users/seal/Documents/projects/tachybase/packages/plugin-auth-saml
|
|
4
|
+
> tachybase-build --no-dts @tachybase/plugin-auth-saml
|
|
5
|
+
|
|
6
|
+
[33m[33mThe CJS build of Vite's Node API is deprecated. See https://vitejs.dev/guide/troubleshooting.html#vite-cjs-node-api-deprecated for more details.[39m[39m
|
|
7
|
+
[4m[95m@tachybase/plugin-auth-saml[39m[24m: [1mplugin-auth-saml[22m build start
|
|
8
|
+
[4m[95m@tachybase/plugin-auth-saml[39m[24m: build plugin client
|
|
9
|
+
[4m[95m@tachybase/plugin-auth-saml[39m[24m: build plugin server source
|
|
10
|
+
[4m[95m@tachybase/plugin-auth-saml[39m[24m: delete server files
|
|
11
|
+
[4m[95m@tachybase/plugin-auth-saml[39m[24m: build plugin server dependencies
|
|
12
|
+
[4m[95m@tachybase/plugin-auth-saml[39m[24m: These packages [33m@node-saml/node-saml[39m will be [3mbundled[23m to dist/node_modules. These packages [33m@tachybase/server, @tachybase/auth, @tachybase/module-auth, @tachybase/actions[39m will be [3mexclude[23m.
|
|
13
|
+
[4m[95m@tachybase/plugin-auth-saml[39m[24m: write external version
|
|
14
|
+
|
package/README.md
ADDED
package/README.zh-CN.md
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# SAML
|
|
2
|
+
|
|
3
|
+
提供SAML2.0 SSO登录功能。
|
|
4
|
+
|
|
5
|
+
## 依赖
|
|
6
|
+
|
|
7
|
+
- `@tachybase/auth` 认证插件,提供认证相关功能,表、模型、函数复用等。
|
|
8
|
+
|
|
9
|
+
## 使用方法
|
|
10
|
+
|
|
11
|
+
> 以Google WorkSpace IdP为例
|
|
12
|
+
|
|
13
|
+
### 将Google设置为IdP
|
|
14
|
+
|
|
15
|
+
[Google管理控制台](https://admin.google.com/) - 应用 - Web应用和移动应用
|
|
16
|
+
|
|
17
|
+
<img src="https://s2.loli.net/2023/05/18/O7UYh9pjePrKzTq.png" width="800px" />
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
进行应用配置之后,复制**SSO网址**、**实体ID**和**证书**。
|
|
21
|
+
|
|
22
|
+
<img src="https://s2.loli.net/2023/05/18/Mpwk3dAIvShmUCe.png" width="800px"/>
|
|
23
|
+
|
|
24
|
+
### 在Tachybase上新增认证器
|
|
25
|
+
|
|
26
|
+
插件设置 - 认证 - 新增 - SAML
|
|
27
|
+
|
|
28
|
+
<img src="https://s2.loli.net/2023/05/18/EpXsJ1BM5lju2mY.png" width="800px" />
|
|
29
|
+
|
|
30
|
+
将刚才复制的信息依次进行填写
|
|
31
|
+
- SSO URL: SSO网址
|
|
32
|
+
- Public Certificate: 证书
|
|
33
|
+
- idP Issuer: 实体id
|
|
34
|
+
- http: 如果是本地http测试可以勾选
|
|
35
|
+
|
|
36
|
+
之后复制`Usage`中的`SP Issuer/EntityID`和`ACS URL`.
|
|
37
|
+
|
|
38
|
+
### 在Google上填写SP信息
|
|
39
|
+
|
|
40
|
+
回到Google控制台,在**服务提供商详细信息**页面,输入刚才复制的ACS网址和实体ID,并勾选**已签署响应**。
|
|
41
|
+
|
|
42
|
+
在**属性映射**位置,添加映射,映射对应属性,Tachybase可供映射的字段有:
|
|
43
|
+
|
|
44
|
+
- email(必填)
|
|
45
|
+
- phone (仅对scope支持phone的平台生效,如阿里云)
|
|
46
|
+
- nickname
|
|
47
|
+
- username
|
|
48
|
+
- firstName
|
|
49
|
+
- lastName
|
|
50
|
+
|
|
51
|
+
用户名使用规则优先级: `nickname` > `username` > `firstName lastName` > `nameID`
|
|
52
|
+
|
|
53
|
+
`nameID`为SAML协议携带,无需映射,将作为用户唯一标识保存。
|
|
54
|
+
|
|
55
|
+
在有email或nameID为email的情况下,登录时将尝试匹配已有用户,否则创建新用户。
|
package/client.d.ts
ADDED
package/client.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require('./dist/client/index.js');
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
(function(e,t){typeof exports=="object"&&typeof module!="undefined"?t(exports,require("@tachybase/client"),require("@tachybase/module-auth/client"),require("react/jsx-runtime"),require("react"),require("@tachybase/schema"),require("@tachybase/sdk"),require("@ant-design/icons"),require("antd"),require("react-i18next"),require("react-router-dom")):typeof define=="function"&&define.amd?define(["exports","@tachybase/client","@tachybase/module-auth/client","react/jsx-runtime","react","@tachybase/schema","@tachybase/sdk","@ant-design/icons","antd","react-i18next","react-router-dom"],t):(e=typeof globalThis!="undefined"?globalThis:e||self,t(e["@tachybase/plugin-auth-saml"]={},e["@tachybase/client"],e["@tachybase/module-auth"],e.jsxRuntime,e.react,e["@tachybase/schema"],e["@tachybase/sdk"],e["@ant-design/icons"],e.antd,e["react-i18next"],e["react-router-dom"]))})(this,function(e,t,u,r,l,y,g,i,a,m,v){"use strict";var I=(e,t,u)=>new Promise((r,l)=>{var y=a=>{try{i(u.next(a))}catch(m){l(m)}},g=a=>{try{i(u.throw(a))}catch(m){l(m)}},i=a=>a.done?r(a.value):Promise.resolve(a.value).then(y,g);i((u=u.apply(e,t)).next())});const F="SAML",C="saml";function q(o){return t.i18n.t(o,{ns:C})}function S(){return m.useTranslation(C)}const j={type:"object",properties:{saml:{type:"object",properties:{ssoUrl:{title:'{{t("SSO URL")}}',"x-component":"Input","x-decorator":"FormItem",required:!0},certificate:{title:'{{t("Public Certificate")}}',"x-component":"Input.TextArea","x-decorator":"FormItem",required:!0},idpIssuer:{title:"idP Issuer","x-component":"Input","x-decorator":"FormItem"},http:{title:'{{t("http")}}',"x-component":"Checkbox","x-decorator":"FormItem"},userBindField:{type:"string",title:'{{t("Use this field to bind the user")}}',"x-component":"Select","x-decorator":"FormItem",default:"email",enum:[{label:q("Email"),value:"email"},{label:q("Username"),value:"username"}],required:!0}}},public:{type:"object",properties:{autoSignup:{"x-decorator":"FormItem",type:"boolean",title:'{{t("Sign up automatically when the user does not exist")}}',"x-component":"Checkbox",default:!0}}},usage:{type:"void","x-component":"Usage"}}},k=y.observer(()=>{var c;const o=y.useForm(),f=t.useRecord(),{t:d}=S(),h=t.useApp(),s=(c=o.values.name)!=null?c:f.name,x=l.useMemo(()=>{var P;const n=h.getOptions(),p=(P=n==null?void 0:n.apiClient)==null?void 0:P.baseURL,{protocol:w,host:B}=window.location,A=g.getSubAppName(h.getPublicPath())||"main";return p.startsWith("http")?`${p}saml:redirect?authenticator=${s}&__appName=${A}`:`${w}//${B}${p}saml:redirect?authenticator=${s}&__appName=${A}`},[h,s]),b=n=>{navigator.clipboard.writeText(n),a.message.success(d("Copied"))};return r.jsxs(a.Card,{title:d("Usage"),type:"inner",children:[r.jsx(t.FormItem,{label:d("SP Issuer/EntityID"),children:r.jsx(t.Input,{value:s,disabled:!0,addonBefore:r.jsx(i.CopyOutlined,{onClick:()=>b(s)})})}),r.jsx(t.FormItem,{label:d("ACS URL"),children:r.jsx(t.Input,{value:x,disabled:!0,addonBefore:r.jsx(i.CopyOutlined,{onClick:()=>b(x)})})})]})},{displayName:"Usage"}),L=()=>{const{t:o}=S();return r.jsx(t.SchemaComponent,{scope:{t:o},components:{Usage:k},schema:j})},T=({authenticator:o})=>{const{t:f}=S(),d=t.useAPIClient(),h=v.useLocation(),s=new URLSearchParams(h.search),x=s.get("redirect"),b=()=>I(this,null,function*(){var p;const c=yield d.request({method:"post",url:"saml:getAuthUrl",headers:{"X-Authenticator":o.name},data:{redirect:x}}),n=(p=c==null?void 0:c.data)==null?void 0:p.data;window.location.replace(n)});return l.useEffect(()=>{const c=s.get("authenticator"),n=s.get("error");if(c===o.name&&n){a.message.error(n);return}}),r.jsx(a.Space,{direction:"vertical",className:t.css`
|
|
2
|
+
display: flex;
|
|
3
|
+
`,children:r.jsx(a.Button,{shape:"round",block:!0,icon:r.jsx(i.LoginOutlined,{}),onClick:b,children:f(o.title)})})};class U extends t.Plugin{load(){return I(this,null,function*(){this.app.pm.get(u).registerType(F,{components:{SignInButton:T,AdminSettingsForm:L}})})}}e.SamlPlugin=U,e.default=U,Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { ISchema } from '@tachybase/schema';
|
|
2
|
+
export declare const formProperties: {
|
|
3
|
+
title: {
|
|
4
|
+
'x-component': string;
|
|
5
|
+
'x-decorator': string;
|
|
6
|
+
description: string;
|
|
7
|
+
};
|
|
8
|
+
clientId: {
|
|
9
|
+
'x-component': string;
|
|
10
|
+
'x-decorator': string;
|
|
11
|
+
};
|
|
12
|
+
issuer: {
|
|
13
|
+
'x-component': string;
|
|
14
|
+
'x-decorator': string;
|
|
15
|
+
};
|
|
16
|
+
loginUrl: {
|
|
17
|
+
'x-component': string;
|
|
18
|
+
'x-decorator': string;
|
|
19
|
+
};
|
|
20
|
+
certificate: {
|
|
21
|
+
'x-component': string;
|
|
22
|
+
'x-decorator': string;
|
|
23
|
+
};
|
|
24
|
+
redirectUrl: {
|
|
25
|
+
'x-component': string;
|
|
26
|
+
'x-decorator': string;
|
|
27
|
+
};
|
|
28
|
+
enabled: {
|
|
29
|
+
'x-component': string;
|
|
30
|
+
'x-decorator': string;
|
|
31
|
+
title: string;
|
|
32
|
+
'x-content': string;
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
export declare const samlSchema: ISchema;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name2 in all)
|
|
7
|
+
__defProp(target, name2, { get: all[name2], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var constants_exports = {};
|
|
19
|
+
__export(constants_exports, {
|
|
20
|
+
authType: () => authType,
|
|
21
|
+
namespace: () => namespace
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(constants_exports);
|
|
24
|
+
var import_package = require("../package.json");
|
|
25
|
+
const authType = "SAML";
|
|
26
|
+
const namespace = import_package.name;
|
|
27
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
28
|
+
0 && (module.exports = {
|
|
29
|
+
authType,
|
|
30
|
+
namespace
|
|
31
|
+
});
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
"react": "18.3.1",
|
|
3
|
+
"@tachybase/client": "0.23.8",
|
|
4
|
+
"@tachybase/schema": "0.23.8",
|
|
5
|
+
"@tachybase/sdk": "0.23.8",
|
|
6
|
+
"@ant-design/icons": "5.3.7",
|
|
7
|
+
"antd": "5.22.5",
|
|
8
|
+
"@tachybase/module-auth": "0.23.8",
|
|
9
|
+
"react-router-dom": "6.28.1",
|
|
10
|
+
"@tachybase/server": "0.23.8",
|
|
11
|
+
"@tachybase/auth": "0.23.8",
|
|
12
|
+
"react-i18next": "15.2.0",
|
|
13
|
+
"@tachybase/actions": "0.23.8"
|
|
14
|
+
};
|
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var src_exports = {};
|
|
30
|
+
__export(src_exports, {
|
|
31
|
+
default: () => import_server.default
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(src_exports);
|
|
34
|
+
__reExport(src_exports, require("./server"), module.exports);
|
|
35
|
+
var import_server = __toESM(require("./server"));
|
|
36
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
37
|
+
0 && (module.exports = {
|
|
38
|
+
...require("./server")
|
|
39
|
+
});
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"Actions": "Actions",
|
|
3
|
+
"Add provider": "Add",
|
|
4
|
+
"Are you sure you want to delete it?": "Are you sure you want to delete it?",
|
|
5
|
+
"Cancel": "Cancel",
|
|
6
|
+
"Client id": "Client id",
|
|
7
|
+
"Delete": "Delete",
|
|
8
|
+
"Delete provider": "Delete",
|
|
9
|
+
"Edit": "Edit",
|
|
10
|
+
"Edit provider": "Edit",
|
|
11
|
+
"Enable": "Enable",
|
|
12
|
+
"Entity id or issuer": "Entity id or issuer",
|
|
13
|
+
"Login Url": "Login Url",
|
|
14
|
+
"Public cert": "Public cert",
|
|
15
|
+
"Redirect url": "Redirect url",
|
|
16
|
+
"SAML Providers": "SAML Providers",
|
|
17
|
+
"SAML manager": "SAML manager",
|
|
18
|
+
"SP entity id": "SP entity id",
|
|
19
|
+
"Sign in button name, which will be displayed on the sign in page": "Sign in button name, which will be displayed on the sign in page",
|
|
20
|
+
"Sign up automatically when the user does not exist": "Sign up automatically when the user does not exist",
|
|
21
|
+
"Submit": "Submit",
|
|
22
|
+
"Title": "Title",
|
|
23
|
+
"Use this field to bind the user": "Use this field to bind the user",
|
|
24
|
+
"User not found": "User not found",
|
|
25
|
+
"Username must be 2-16 characters in length (excluding @.<>\"'/)": "Username must be 2-16 characters in length (excluding @.<>\"'/)"
|
|
26
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"Actions": "Acciones",
|
|
3
|
+
"Add provider": "Añadir Proveedor",
|
|
4
|
+
"Are you sure you want to delete it?": "¿Está seguro de que quiere borrarlo?",
|
|
5
|
+
"Cancel": "Cancelar",
|
|
6
|
+
"Client id": "Id de cliente",
|
|
7
|
+
"Delete": "Borrar",
|
|
8
|
+
"Delete provider": "Borrar Proveedor",
|
|
9
|
+
"Edit": "Editar",
|
|
10
|
+
"Edit provider": "Editar Proveedor",
|
|
11
|
+
"Enable": " Activar ",
|
|
12
|
+
"Entity id or issuer": "Id de entidad o emisor",
|
|
13
|
+
"Login Url": "Url de inicio de sesión",
|
|
14
|
+
"Public cert": "Certificado público",
|
|
15
|
+
"Redirect url": "Redirect url",
|
|
16
|
+
"SAML Providers": "Proveedores SAML",
|
|
17
|
+
"SAML manager": "Gestor SAML",
|
|
18
|
+
"SP entity id": "SP entity id",
|
|
19
|
+
"Sign in button name, which will be displayed on the sign in page": "Nombre del botón de inicio de sesión, que se mostrará en la página de inicio de sesión",
|
|
20
|
+
"Submit": "Enviar",
|
|
21
|
+
"Title": "Título"
|
|
22
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"Actions": "Actions",
|
|
3
|
+
"Add provider": "Ajouter",
|
|
4
|
+
"Are you sure you want to delete it?": "Êtes-vous sûr de vouloir le supprimer ?",
|
|
5
|
+
"Cancel": "Annuler",
|
|
6
|
+
"Client id": "Client id",
|
|
7
|
+
"Delete": "Supprimer",
|
|
8
|
+
"Delete provider": "Supprimer",
|
|
9
|
+
"Edit": "Modifier",
|
|
10
|
+
"Edit provider": "Modifier",
|
|
11
|
+
"Enable": "Activer",
|
|
12
|
+
"Entity id or issuer": "Entity id or issuer",
|
|
13
|
+
"Login Url": "Url de connexion",
|
|
14
|
+
"Public cert": "Public cert",
|
|
15
|
+
"Redirect url": "Url de redirection",
|
|
16
|
+
"SAML Providers": "SAML Providers",
|
|
17
|
+
"SAML manager": "SAML manager",
|
|
18
|
+
"SP entity id": "SP entity id",
|
|
19
|
+
"Sign in button name, which will be displayed on the sign in page": "Nom du bouton de connexion, qui sera affiché sur la page de connexion",
|
|
20
|
+
"Submit": "Envoyer",
|
|
21
|
+
"Title": "Titre"
|
|
22
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
{
|
|
2
|
+
"Actions": "동작",
|
|
3
|
+
"Add provider": "추가",
|
|
4
|
+
"Are you sure you want to delete it?": "삭제하시겠습니까?",
|
|
5
|
+
"Button title": "로그인 버튼 제목",
|
|
6
|
+
"Cancel": "취소",
|
|
7
|
+
"Client id": "클라이언트 ID",
|
|
8
|
+
"Copied": "복사됨",
|
|
9
|
+
"Delete": "삭제",
|
|
10
|
+
"Delete provider": "삭제",
|
|
11
|
+
"Edit": "편집",
|
|
12
|
+
"Edit provider": "편집",
|
|
13
|
+
"Enable": "사용",
|
|
14
|
+
"Entity id or issuer": "IdP 고유 식별자",
|
|
15
|
+
"Login Url": "로그인 URL",
|
|
16
|
+
"Public cert": "공개 키",
|
|
17
|
+
"Redirect url": "리디렉션 URL",
|
|
18
|
+
"SAML Providers": "SAML 제공자",
|
|
19
|
+
"SAML manager": "SAML 매니저",
|
|
20
|
+
"SP entity id": "애플리케이션 고유 식별자 (SP Entity ID)",
|
|
21
|
+
"Sign in button name, which will be displayed on the sign-in page": "로그인 페이지에 표시되는 로그인 버튼 이름",
|
|
22
|
+
"Sign up automatically when the user does not exist": "사용자가 존재하지 않을 때 자동으로 가입",
|
|
23
|
+
"Submit": "제출",
|
|
24
|
+
"Title": "이름",
|
|
25
|
+
"Usage": "사용",
|
|
26
|
+
"Use this field to bind the user": "이 필드를 사용하여 사용자를 바인딩합니다",
|
|
27
|
+
"User not found": "사용자를 찾을 수 없음",
|
|
28
|
+
"Username must be 2-16 characters in length (excluding @.<>\"'/)": "사용자 이름은 2-16 자여야합니다 (@.<>\"'/ 제외)"
|
|
29
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"Actions": "Ações",
|
|
3
|
+
"Add provider": "Adicionar",
|
|
4
|
+
"Are you sure you want to delete it?": "Tem certeza de que deseja excluí-lo?",
|
|
5
|
+
"Cancel": "Cacelar",
|
|
6
|
+
"Client id": "ID do cliente",
|
|
7
|
+
"Delete": "Excluir",
|
|
8
|
+
"Delete provider": "Excluir",
|
|
9
|
+
"Edit": "Editar",
|
|
10
|
+
"Edit provider": "Editar",
|
|
11
|
+
"Enable": "Ativo",
|
|
12
|
+
"Entity id or issuer": "ID da entidade ou emissor",
|
|
13
|
+
"Login Url": "URL de login",
|
|
14
|
+
"Public cert": "Certificado público",
|
|
15
|
+
"Redirect url": "URL de redirecionamento",
|
|
16
|
+
"SAML Providers": "Fornecedores SAML",
|
|
17
|
+
"SAML manager": "Gerenciador SAML",
|
|
18
|
+
"SP entity id": "ID da entidade do provedor de serviços",
|
|
19
|
+
"Sign in button name, which will be displayed on the sign in page": "Nome do botão de login, que será exibido na página de login",
|
|
20
|
+
"Submit": "Enviar",
|
|
21
|
+
"Title": "Titulo"
|
|
22
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
{
|
|
2
|
+
"Actions": "操作",
|
|
3
|
+
"Add provider": "添加",
|
|
4
|
+
"Are you sure you want to delete it?": "你确定要删除它吗?",
|
|
5
|
+
"Button title": "登录按钮标题",
|
|
6
|
+
"Cancel": "取消",
|
|
7
|
+
"Client id": "客户端 id",
|
|
8
|
+
"Copied": "已复制",
|
|
9
|
+
"Delete": "删除",
|
|
10
|
+
"Delete provider": "删除",
|
|
11
|
+
"Edit": "编辑",
|
|
12
|
+
"Edit provider": "编辑",
|
|
13
|
+
"Enable": "启用",
|
|
14
|
+
"Entity id or issuer": "IdP 唯一标识",
|
|
15
|
+
"Login Url": "登录地址",
|
|
16
|
+
"Public cert": "公钥",
|
|
17
|
+
"Redirect url": "重定向地址",
|
|
18
|
+
"SAML Providers": "SAML 身份提供者",
|
|
19
|
+
"SAML manager": "SAML 管理",
|
|
20
|
+
"SP entity id": "应用唯一标识(SP Entity ID)",
|
|
21
|
+
"Sign in button name, which will be displayed on the sign in page": "登录按钮名称,将在登录页中显示",
|
|
22
|
+
"Sign up automatically when the user does not exist": "用户不存在时自动注册",
|
|
23
|
+
"Submit": "提交",
|
|
24
|
+
"Title": "名称",
|
|
25
|
+
"Usage": "使用",
|
|
26
|
+
"Use this field to bind the user": "使用此字段绑定用户",
|
|
27
|
+
"User not found": "用户不存在",
|
|
28
|
+
"Username must be 2-16 characters in length (excluding @.<>\"'/)": "用户名必须为2-16个字符并且不包含@.<>\"'/)"
|
|
29
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
Copyright (c) 2012 Henri Bergius
|
|
2
|
+
Copyright (c) 2011 Michael Bosworth
|
|
3
|
+
|
|
4
|
+
Permission is hereby granted, free of charge, to any person
|
|
5
|
+
obtaining a copy of this software and associated documentation
|
|
6
|
+
files (the "Software"), to deal in the Software without
|
|
7
|
+
restriction, including without limitation the rights to use,
|
|
8
|
+
copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the
|
|
10
|
+
Software is furnished to do so, subject to the following
|
|
11
|
+
conditions:
|
|
12
|
+
|
|
13
|
+
The above copyright notice and this permission notice shall be
|
|
14
|
+
included in all copies or substantial portions of the Software.
|
|
15
|
+
|
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
|
18
|
+
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
|
20
|
+
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
|
21
|
+
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
22
|
+
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
|
23
|
+
OTHER DEALINGS IN THE SOFTWARE.
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import * as crypto from "crypto";
|
|
3
|
+
export declare function getSigningAlgorithm(shortName?: string): string;
|
|
4
|
+
export declare function getDigestAlgorithm(shortName?: string): string;
|
|
5
|
+
export declare function getSigner(shortName?: string): crypto.Signer;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getSigner = exports.getDigestAlgorithm = exports.getSigningAlgorithm = void 0;
|
|
4
|
+
const crypto = require("crypto");
|
|
5
|
+
function getSigningAlgorithm(shortName) {
|
|
6
|
+
switch (shortName) {
|
|
7
|
+
case "sha256":
|
|
8
|
+
return "http://www.w3.org/2001/04/xmldsig-more#rsa-sha256";
|
|
9
|
+
case "sha512":
|
|
10
|
+
return "http://www.w3.org/2001/04/xmldsig-more#rsa-sha512";
|
|
11
|
+
case "sha1":
|
|
12
|
+
default:
|
|
13
|
+
return "http://www.w3.org/2000/09/xmldsig#rsa-sha1";
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
exports.getSigningAlgorithm = getSigningAlgorithm;
|
|
17
|
+
function getDigestAlgorithm(shortName) {
|
|
18
|
+
switch (shortName) {
|
|
19
|
+
case "sha256":
|
|
20
|
+
return "http://www.w3.org/2001/04/xmlenc#sha256";
|
|
21
|
+
case "sha512":
|
|
22
|
+
return "http://www.w3.org/2001/04/xmlenc#sha512";
|
|
23
|
+
case "sha1":
|
|
24
|
+
default:
|
|
25
|
+
return "http://www.w3.org/2000/09/xmldsig#sha1";
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
exports.getDigestAlgorithm = getDigestAlgorithm;
|
|
29
|
+
function getSigner(shortName) {
|
|
30
|
+
switch (shortName) {
|
|
31
|
+
case "sha256":
|
|
32
|
+
return crypto.createSign("RSA-SHA256");
|
|
33
|
+
case "sha512":
|
|
34
|
+
return crypto.createSign("RSA-SHA512");
|
|
35
|
+
case "sha1":
|
|
36
|
+
default:
|
|
37
|
+
return crypto.createSign("RSA-SHA1");
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
exports.getSigner = getSigner;
|
|
41
|
+
//# sourceMappingURL=algorithms.js.map
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
export declare const keyToPEM: (key: string | Buffer) => string | Buffer;
|
|
3
|
+
export declare const certToPEM: (cert: string) => string;
|
|
4
|
+
export declare const generateUniqueId: () => string;
|
|
5
|
+
export declare const removeCertPEMHeaderAndFooter: (certificate: string) => string;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.removeCertPEMHeaderAndFooter = exports.generateUniqueId = exports.certToPEM = exports.keyToPEM = void 0;
|
|
4
|
+
const crypto = require("crypto");
|
|
5
|
+
const utility_1 = require("./utility");
|
|
6
|
+
const keyToPEM = (key) => {
|
|
7
|
+
(0, utility_1.assertRequired)(key, "key is required");
|
|
8
|
+
if (typeof key !== "string")
|
|
9
|
+
return key;
|
|
10
|
+
if (key.split(/\r?\n/).length !== 1)
|
|
11
|
+
return key;
|
|
12
|
+
const matchedKey = key.match(/.{1,64}/g);
|
|
13
|
+
if (matchedKey) {
|
|
14
|
+
const wrappedKey = [
|
|
15
|
+
"-----BEGIN PRIVATE KEY-----",
|
|
16
|
+
...matchedKey,
|
|
17
|
+
"-----END PRIVATE KEY-----",
|
|
18
|
+
"",
|
|
19
|
+
].join("\n");
|
|
20
|
+
return wrappedKey;
|
|
21
|
+
}
|
|
22
|
+
throw new Error("Invalid key");
|
|
23
|
+
};
|
|
24
|
+
exports.keyToPEM = keyToPEM;
|
|
25
|
+
const certToPEM = (cert) => {
|
|
26
|
+
const lines = cert.match(/.{1,64}/g);
|
|
27
|
+
(0, utility_1.assertRequired)(lines, "cert is invalid");
|
|
28
|
+
let pem = lines.join("\n");
|
|
29
|
+
if (pem.indexOf("-BEGIN CERTIFICATE-") === -1)
|
|
30
|
+
pem = "-----BEGIN CERTIFICATE-----\n" + pem;
|
|
31
|
+
if (pem.indexOf("-END CERTIFICATE-") === -1)
|
|
32
|
+
pem = pem + "\n-----END CERTIFICATE-----\n";
|
|
33
|
+
return pem;
|
|
34
|
+
};
|
|
35
|
+
exports.certToPEM = certToPEM;
|
|
36
|
+
const generateUniqueId = () => {
|
|
37
|
+
return "_" + crypto.randomBytes(20).toString("hex");
|
|
38
|
+
};
|
|
39
|
+
exports.generateUniqueId = generateUniqueId;
|
|
40
|
+
const removeCertPEMHeaderAndFooter = (certificate) => {
|
|
41
|
+
// These headers and footers are standard: https://www.ssl.com/guide/pem-der-crt-and-cer-x-509-encodings-and-conversions/#ftoc-heading-1
|
|
42
|
+
certificate = certificate.replace(/-----BEGIN CERTIFICATE-----\r?\n?/, "");
|
|
43
|
+
certificate = certificate.replace(/-----END CERTIFICATE-----\r?\n?/, "");
|
|
44
|
+
certificate = certificate.replace(/\r\n/g, "\n");
|
|
45
|
+
return certificate;
|
|
46
|
+
};
|
|
47
|
+
exports.removeCertPEMHeaderAndFooter = removeCertPEMHeaderAndFooter;
|
|
48
|
+
//# sourceMappingURL=crypto.js.map
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Return the current time in ISO format.
|
|
3
|
+
*/
|
|
4
|
+
export declare const generateInstant: () => string;
|
|
5
|
+
/**
|
|
6
|
+
* Convert a date string to a timestamp (in milliseconds).
|
|
7
|
+
*
|
|
8
|
+
* @param dateString A string representation of a date
|
|
9
|
+
* @param label Descriptive name of the date being passed in, e.g. "NotOnOrAfter"
|
|
10
|
+
* @throws Will throw an error if parsing `dateString` returns `NaN`
|
|
11
|
+
* @returns {number} The timestamp (in milliseconds) representation of the given date
|
|
12
|
+
*/
|
|
13
|
+
export declare const dateStringToTimestamp: (dateString: string, label: string) => number;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.dateStringToTimestamp = exports.generateInstant = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Return the current time in ISO format.
|
|
6
|
+
*/
|
|
7
|
+
const generateInstant = () => {
|
|
8
|
+
return new Date().toISOString();
|
|
9
|
+
};
|
|
10
|
+
exports.generateInstant = generateInstant;
|
|
11
|
+
/**
|
|
12
|
+
* Convert a date string to a timestamp (in milliseconds).
|
|
13
|
+
*
|
|
14
|
+
* @param dateString A string representation of a date
|
|
15
|
+
* @param label Descriptive name of the date being passed in, e.g. "NotOnOrAfter"
|
|
16
|
+
* @throws Will throw an error if parsing `dateString` returns `NaN`
|
|
17
|
+
* @returns {number} The timestamp (in milliseconds) representation of the given date
|
|
18
|
+
*/
|
|
19
|
+
const dateStringToTimestamp = (dateString, label) => {
|
|
20
|
+
const dateMs = Date.parse(dateString);
|
|
21
|
+
if (isNaN(dateMs)) {
|
|
22
|
+
throw new Error(`Error parsing ${label}: '${dateString}' is not a valid date`);
|
|
23
|
+
}
|
|
24
|
+
return dateMs;
|
|
25
|
+
};
|
|
26
|
+
exports.dateStringToTimestamp = dateStringToTimestamp;
|
|
27
|
+
//# sourceMappingURL=datetime.js.map
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { SAML } from "./saml";
|
|
2
|
+
import { CacheItem, CacheProvider, MandatorySamlOptions, Profile, SamlConfig, SamlOptions, ValidateInResponseTo } from "./types";
|
|
3
|
+
export { SAML, CacheItem, CacheProvider, SamlOptions, MandatorySamlOptions, Profile, SamlConfig, ValidateInResponseTo, };
|