Ponytech / appstoreconnectapi

Python wrapper around Apple App Store Api
https://ponytech.net/projects/app-store-connect
MIT License
159 stars 74 forks source link

Provide a properly configured and signed bearer token, and make sure that it has not expired. #41

Open mybluedog24 opened 2 years ago

mybluedog24 commented 2 years ago

I just installed this yesterday and it worked fine. But today it starts throw error "Provide a properly configured and signed bearer token, and make sure that it has not expired. Learn more about Generating Tokens for API Requests https://developer.apple.com/go/?id=api-generating-tokens".

At the end I found out it maybe caused by the expiration time. When I changed it from 20 to 15, it works again: exp = int(time.mktime((self.token_gen_date + timedelta(minutes=15)).timetuple())) On documentation here: https://developer.apple.com/documentation/appstoreconnectapi/generating_tokens_for_api_requests it says Tokens that expire more than 20 minutes into the future are not valid so I guess when do the calculation with 20 mins it may round up to exceed 20 mins?

Updated: after I sync the time on my PC, it works again with 20mins.

ppawlak commented 2 years ago

Updated: after I sync the time on my PC, it works again with 20mins.

Indeed you need to have your computer clock with a correct time otherwise it will cause issues. I will add this requirement to the README, thanks for reporting it.

vmesel commented 9 months ago

@ppawlak I'm running on containers without modifying date or time, is this still a thing?