basic authentication failed错误问题

wapchief
2017-09-25 08:06 2.5k 0

错误信息:

{
error: {
message: "basic authentication failed",
code: 899008
}
}

日志:

09-25 15:58:50.419 30007-30007/com.wapchief.jpushim E/base64_auth_string: YjQ3YTM3ZjM0MmViYTVmOWZiY2QxOTYxOm1hc3RlclNlY3JldA==
09-25 15:58:50.588 30007-30007/com.wapchief.jpushim E/Log:会话消息数: 4
09-25 16:27:21.999 3744-3744/com.wapchief.jpushim E/onresponseUser======: Response{protocol=h2, code=400, message=, url=https://api.im.jpush.cn/v1/users/1006}
09-25 16:27:21.999 3744-3744/com.wapchief.jpushim E/onresponse======: Response{protocol=h2, code=401, message=, url=https://api.im.jpush.cn/v1/users/1006/userstat}

代码:

public static String AppKey="b47a37f342eba5f9fbcd1961";
public static String base64_auth_string = Base64Utils.getBase64(AppKey +":"+"masterSecret");


   /*获取请求头*/
    public static void headers() {
        httpClient.addInterceptor(new Interceptor() {

            public okhttp3.Response intercept(Chain chain) throws IOException {
                Request request = chain.request()
                        .newBuilder()
                        .addHeader("Content-Type", "application/json; charset=utf-8")
                        .addHeader("Authorization", "Basic " + base64_auth_string)
                        .build();
                return chain.proceed(request);
            }
        });
    }

2个回答

热门排序