Replies: 1 comment
-
可以参照服务端 ClientAuthenticationFilter 的校验逻辑看下 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
hello,我是在java代码中使用okHttp3请求apollo 明细如下:
调用接口:
1.3 通过不带缓存的Http接口从Apollo读取配置
该接口会直接从数据库中获取配置,可以配合配置推送通知实现实时更新配置。
我的代码:
String httpUrl = String.format("%s/configs/%s/default/application",uri,appId);
Map<String, String> headerMap = Signature.buildHttpHeaders(httpUrl, appId, secret);
String ret = HttpClientUtils.get(httpUrl, HttpClientUtils.headers(headerMap));
http部分:
Request request = new Request.Builder().headers(headers).url(url).get().build();
Response response = client.newCall(request).execute();
body = response.body().string();
Signature是直接调用的apollo client包中的(1.9.2)
只要开启了apollo的secret,验签就过不去会401, 很尴尬..
我看文档上也是请求和加签,请问是我是哪里遗漏了么 ?
Beta Was this translation helpful? Give feedback.
All reactions