天天看点

金蝶云如何html5登录,第三方系统单点登录到金蝶云指南V2

启用第三方系统登录授权

金蝶云如何html5登录,第三方系统单点登录到金蝶云指南V2

2   测试第三方系统单点登陆

使用生成的链接测试是否能正常的单点登录。

金蝶云如何html5登录,第三方系统单点登录到金蝶云指南V2

3   在第三方系统中生成签名授权的URL

【参数格式】:ud={"dbid":"5be178b96562c0","username":"Administrator","appid":"1","signeddata":"804e89bc062fd55cc463617b964530e12b90b540","timestamp":"1545815603",

"lcid":"2052","origintype":"SimPas","entryrole":"","formid":"","formtype":"","pkid":"","otherargs":""}

【参数说明】:

dbid:数据中心的ID;

username:用户名称;

appid:应用程序ID,通过Administrator登录数据中心后,在【系统管理】分类的【第三方系统登录授权】功能里面进行新增维护;(云之家可以不填由querystring参数决定)

signeddata:参考文章【http://club.kingdee.com/forum.php?mod=viewthread&tid=1026953】;

timestamp:登录时间戳(Unix时间戳,定义为从格林威治时间1970年01月01日00时00分00秒起至现在的总秒数);

lcid(可选):语言ID,中文2052(默认),英文1033,繁体3076;

origintype: XT=云之家集成(同时要求entryrole=XT);SimPas=简单通行证集成;

entryrole:验证权限的入口角色;

formid: 登录后默认打开功能的表单id;

formtype:登录后默认打开功能的格式,目前有单据bill和列表list两种方式,没有列表的功能统一为bill;

pkid:formid对应表单的主键;formtype为list时忽略,formtype为bill时起作用,如果为空表示新增状态;

otherargs:作为用户自定义参数传入,使用于二开,具体内容和格式由二开人员确定,最终在指定表单的插件中通过GetCustomParameter(FormConst.StartAppArgs)获取,具体参考【http://club.kingdee.com/forum.php?mod=viewthread&tid=1028839】

.

NET示例代码如下:

using Kingdee.BOS.Util;

using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

using Kingdee.BOS.BusinessEntity.Login;

namespace PassportLogin

{

class Program

{

static void Main(string[] args)

{

int lcId = 2052;

long timestamp = DateTimeFormatUtils.CurrentTimeMillis() / 1000;//时间戳

string dbId = "57b11d0f7a3b1a";//数据中心ID

string usserName = "ly";//用户名称

string appId = "SRMLightApp";//第三方系统应用Id

string appSecret = "7d9169bfbdc34e9cbd96069db5e72917";//第三方系统应用秘钥

string[] arr = new string[] { dbId, usserName, appId, appSecret, timestamp.ToString() };

string sign = Kingdee.BOS.Util.SHA1Util.GetSignature(arr);//签名

SimplePassportLoginArg arg = new SimplePassportLoginArg();

arg.appid = appId;

arg.dbid = dbId;

arg.lcid = lcId.ToString();

arg.origintype = "SimPas";

arg.signeddata = sign;

arg.timestamp = timestamp.ToString();

arg.username = usserName;

arg.entryrole = string.Empty;

arg.formid = string.Empty;

arg.formtype = string.Empty;

arg.otherargs = string.Empty;

arg.pkid = string.Empty;

string argJosn = Kingdee.BOS.JSON.KDObjectConverter.SerializeObject(arg);//json格式

string argJsonBase64 = System.Text.UTF8Encoding.UTF8.GetBytes(argJosn).ToBase64();//base64编码

string silverlightUrl = "http://localhost/K3Cloud/Silverlight/IndexSL.aspx?ud=" + argJsonBase64;// Silverlight入口链接

string html5Url = "http://localhost/K3Cloud/html5/IndexSL.aspx?ud=" + argJsonBase64;// html5入口链接

Console.WriteLine(silverlightUrl);

Console.WriteLine(html5Url);

Console.ReadLine();

}

}

}

中文名的进不去只到登录界面,请配置

common.config配置   

4   从第三方系统注销用户

接口地址:http://ip/K3Cloud/Kingdee.BOS.ServiceFacade.ServicesStub.User.UserService.LogoutByOtherSystem.common.kdsvc

请求类型:post

参数

参数名称:ap0

参数值:{"AcctID":"5ab22542230aaf","AppId":"hr","Username":"txt","SignedData":"4cdde33b74d55c328291a24f299cb745a50621bc","Timestamp":1525413177}

AcctID:数据中心ID

Username:为要注销的用户名称

AppId:应用ID

SignedData:签名数据,算法同上

Timestamp:时间戳

金蝶云如何html5登录,第三方系统单点登录到金蝶云指南V2

5、知识扩展链接

V1版本集成:https://vip.kingdee.com/article/1245利用启动插件校验机制实现免登录功能,实现跨系统无缝集成参考如下文章:

http://club.kingdee.com/forum.php?mod=viewthread&tid=1332377