ecency / hivesigner-sdk

Hivesigner SDK
https://hivesigner.com
MIT License
2 stars 1 forks source link

Create access token using refresh token #22

Closed josephkhanssd closed 1 year ago

josephkhanssd commented 1 year ago

Need clarification on these two issues

  1. What is client_id here? is it hive username? I am getting a code if I use hivesigner or a hive username or hive.blog (https://hivesigner.com/oauth2/authorize?client_id=CLIENT_ID&redirect_uri=REDIRECT_URI&response_type=code&scope=offline,comment,vote,comment_option,custom_json)
  2. I got the access_token, refresh_token, expires_in and username. But how do I use that refresh_token to create a new access_token? There is no mention of this in the docs.
feruzm commented 1 year ago

Hi,

  1. Yes
  2. Check here, there is way to generate access token with refresh token mentioned here: https://docs.hivesigner.com/h/guides/get-started/hivesigner-oauth2
josephkhanssd commented 1 year ago

token_expiration is 604800. I have checked the code it is hardcoded. is it in seconds?

feruzm commented 1 year ago

@josephkhanssd yes, 7 days. Your application should handle expiry logic.

josephkhanssd commented 1 year ago

@feruzm Got it. Thanks