wialon,新登录mechanizm

时间:2015-08-17 12:26:14

标签: java url

连接输出流代码:

.controls {
    top: 50px;
    width: 100%;
    height: 100px;
    position:relative;
}
.control-left {
    left:0;
}
.control-right {
    right:0;
}
.control-left, .control-right {
    width: 50px;
    height: 50px;
    background-color: #000;
    position: absolute;
    color: #fff;
}
.container {
    max-width: 100%;
    overflow: hidden;
    position: relative;
}
.productsWrapper {
    display: inline-block;

}
.sliderHolder {
    position:relative;
    width: 28000px;
    right: 0px;
}
img {
    width: 200px;
}
article {
    width: 200px !important;
    float: left;
}

的servlet:

URL url = new URL("http://example.com/oauth.html");
String data = encode("client_id") + "=" + encode("GarageGPSLocal");
data += "&" + encode("redirect_uri") + "=" + encode("http://localhost:8084/Wialon/Servlet");
data += "&" + encode("access_type") + "=" + encode("0x100");
data += "&" + encode("activation_time") + "=" + encode("0");
data += "&" + encode("duration") + "=" + encode("2592000");
data += "&" + encode("flags") + "=" + encode("6");
data += "&" + encode("login") + "=" + encode("demo");
data += "&" + encode("passw") + "=" + encode("demo");

URLConnection connection = url.openConnection();
connection.setDoOutput(true);

OutputStreamWriter writer = new OutputStreamWriter(connection.getOutputStream());
writer.write(data);
writer.flush();

setBufferedReader(new BufferedReader(new InputStreamReader(connection.getInputStream())));
this.sessionId = loginToken(reader.readLine());

有没有办法在不使用servlet的情况下从get ['access_token']中捕获?什么写入参数redirect_uri ??

1 个答案:

答案 0 :(得分:2)

您无法使用此类方法生成令牌。允许仅使用本机Wialon表单http://example.com/login.html生成令牌。 几周前,此漏洞已得到修复。