OAuth簽名開發包 Signpost
Signpost 是一個簡單而且直觀的使用 OAuth 1.0 規范對 HTTP 消息進行簽名的 Java 解決方案。支持的 HTTP 客戶端包有:
- Java HttpURLConnection
- Apache Commons HTTP 4.x
- Jetty HTTP Client v6.x
示例代碼:
// create an HTTP request to a protected resource URL url = new URL("http://api.example.com/protected") HttpURLConnection request = (HttpURLConnection) url.openConnection(); // sign the request (consumer is a Signpost DefaultOAuthConsumer) consumer.sign(request); // send the request request.connect();
本文由用戶 openkk 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!