2

I have an django application which gets the google drive token from front-end to be able to download the file from google drive. Then stores the token in the database. I used the 100 char field for storing the token, but starting from database I get error, that token has bigger length.

So how can I know what is the max length of the took google API will return?

I saw the answer for question Can access token be longer than 255 characters? which says I shouldn't use the limit.

But how I can make sure I know when google changes something in their API?

Community
  • 1
  • 1
Gagik Sukiasyan
  • 846
  • 6
  • 17

2 Answers2

2

The suggestion here is not to put a limit on the length in choosing the datatype you used in your database.

Community
  • 1
  • 1
Bardy
  • 2,100
  • 1
  • 13
  • 11
  • Thanks for the response! I saw that discussion, but i didn't relate to my question, because the issue I have started happening just couple of days ago. And I wonder if google has changed anything in token generation? – Gagik Sukiasyan Dec 07 '16 at 17:42
  • I think the point of the thread applies: there is no real need to impose a limit and who knows what they may change in the future and why. Plan accordingly etc. – Bardy Dec 07 '16 at 17:45
  • I updated my question to be more specific - I would like to understand if google changed the way they generate token, and if so, how I can be aware of such changes in future. Thanks for helping to be more specific in my question. – Gagik Sukiasyan Dec 07 '16 at 17:53
2

So how can I know what is the max length of the took google API will return?

Google hasn't documented it and this linked answer refers to the OAuth 2 spec A.12 being specified as minimum 1 character and unbounded.

But how I can make sure I know when google changes something in their API?

If Google changes something that was previously documented, there's likely to be a new version or a deprecation note and a blog post or release note. If (like in this case) they changed something that wasn't documented then you'll find out about it from your own or others' experience (here and other community forums are good places).

Community
  • 1
  • 1
Peter
  • 5,501
  • 2
  • 26
  • 42