ssotoken获取示例

master
youhong.ai 2023-11-22 11:18:00 +08:00
parent 0f20b6b3b8
commit d975263da7
1 changed files with 6 additions and 5 deletions

View File

@ -12,16 +12,17 @@ import cn.hutool.http.HttpRequest;
public class SsoTokenJumpEcology { public class SsoTokenJumpEcology {
/** ecology方提供的appID */ /** ecology方提供的appID */
private static final String APP_ID = "NCCloud"; private static final String APP_ID = "2beecb36-71ab-4af8-9762-484ee2cb449b";
public static void main(String[] args) { public static void main(String[] args) {
// 注意这里是对应ECOLOGY 系统的地址数据信息 // 注意这里是对应ECOLOGY 系统的地址数据信息
String ecUrlHost = "http://10.86.0.248"; String ecUrlHost = "http://10.86.0.248";
String ssoToken = HttpRequest String ssoToken = HttpRequest
.get(ecUrlHost + "/ssologin/checkToken") .post(ecUrlHost + "/ssologin/getToken")
.header("appid", APP_ID) //.header("Content-Type", "application/x-www-form-urlencoded")
.header("loginid", "1") .form("appid", APP_ID)
.form("loginid", "sysadmin")
.execute().body(); .execute().body();
System.out.println("ecology ssoToken is :" + ssoToken); System.out.println("ecology ssoToken is :" + ssoToken);
System.out.println("you can try jump to this url: " + "http://10.86.0.248/spa/cube/index.html?ssoToken=" + ssoToken + "#/main/cube/search?customid=2000017&billid=278,279"); System.out.println("you can try jump to this url: " + "http://10.86.0.248/spa/cube/index.html?ssoToken=" + ssoToken + "#/main/cube/search?customid=2000017&billid=278,279");