简体   繁体   中英

Java App Engine OAuth RSA-SHA1

I have code that is sending an https GET request, to a provider, the code looks like this:

URL url = new URL(REQUEST_TOKEN_URL);
        HttpURLConnection connection = (HttpURLConnection) url.openConnection();
        connection.setDoOutput(true);
        connection.setRequestMethod("GET");
        connection.addRequestProperty("Content-Type", "application/json");
        connection.addRequestProperty("Authorization", lAuthHeader);

if I take the Authorization header and directly run it in my browser using a REST client against the URL I get a 200 OK, if I run it in my java code and read back the body text I get a 403 forbidden warning me I need to send over a known SSL certificate.

The only difference is in my browser I get this popup before the client will send the request: 在此处输入图片说明

Thanks for the help!

The answer is it can't be done, at least I couldn't figure out how to do it. I believe App Engine's lack of ability to allow you signed imported private key stores is to blame here. Maybe some day they will fix this or maybe we can stop using RSA-SHA1 and all use OAuth 2.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM