How to create (OAuthv1) RSA-SHA1 Postman Authorization request header with Axios in NodeJS

半世苍凉 提交于 2020-12-27 07:19:25

问题


I would like to convert the following Postman Authorization request into an Axios http Authorization request.

Here is an example of the headers from Postman

{ Authorization: 
OAuth oauth_consumer_key="Oauth%20key",oauth_token="I9mo8rYA1t7U7bu51mdMlSGx6pBkAGVz",oauth_signature_method="RSA-SHA1",oauth_timestamp="1607311840",oauth_nonce="UmbuDisXoIy",oauth_version="1.0",oauth_signature="QcO7tTLIgOv5AJVkNZzZwraV4T6fmGM8wCQM0zpLfylhv7ubL%2F1zYSEm6Pou7RGd4h9Z4CEIQ0J6zieC2djx3TmHkoZzx1nTJf%2Bc4mCs%2BKzfMZOYm2VKtMpfJf17HoEG6T18FMK75pfQIKbY0C45comcE%2Bna3TWR3Utb4YwKftY%3D"
}

How will I get the same headers generated by Postman with the use of axios?

I've tried the method stated here : OAuth1.0 header in Node.js, but I think its for HMAC signature. I cannot find any example that uses RSA-SHA1 to create Auth header, most of them are using HMAC.

Note: above example works fine with Postman. I just need a way to do it in NodeJS via axios.

来源:https://stackoverflow.com/questions/65193587/how-to-create-oauthv1-rsa-sha1-postman-authorization-request-header-with-axios

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!