ssotoken获取示例
parent
0f20b6b3b8
commit
d975263da7
|
@ -12,18 +12,19 @@ import cn.hutool.http.HttpRequest;
|
|||
public class SsoTokenJumpEcology {
|
||||
|
||||
/** 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) {
|
||||
// 注意这里是对应ECOLOGY 系统的地址数据信息
|
||||
String ecUrlHost = "http://10.86.0.248";
|
||||
String ssoToken = HttpRequest
|
||||
.get(ecUrlHost + "/ssologin/checkToken")
|
||||
.header("appid", APP_ID)
|
||||
.header("loginid", "1")
|
||||
.post(ecUrlHost + "/ssologin/getToken")
|
||||
//.header("Content-Type", "application/x-www-form-urlencoded")
|
||||
.form("appid", APP_ID)
|
||||
.form("loginid", "sysadmin")
|
||||
.execute().body();
|
||||
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");
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue