0

This question refers to youtube, specifically youtube analytics API and OAuth flow.

Using a ruby server-side webapp, I have created a token.

I now want to use that token in a client-side python app.

I have the client_secrets.json that generated the token.

I have generated tokens with python before and the format does not match that of the ruby generated token.

Is there existing code or a simple way to convert the ruby formatted token for use in python? Yes, they are both json but the structures are different.

https://developers.google.com/youtube/reporting/guides/authorization/server-side-web-apps

ProGirlXOXO
  • 2,170
  • 6
  • 25
  • 47

1 Answers1

2

Assuming that you use the same client id and client secret for both ruby and python. The refresh token that you got from one will work in the other.

Raw Oauth response:

{
"access_token" : "ya29.1.AADtN_VSBMC2Ga2lhxsTKjVQ_ROco8VbD6h01aj4PcKHLm6qvHbNtn-_BIzXMw",
"token_type" : "Bearer",
"expires_in" : 3600,
"refresh_token" : "1/J-3zPA8XR1o_cXebV9sDKn_f5MTqaFhKFxH-3PUPiJ4"
}

Assuming you are using the client libraries then the issue you are going to have is how the different libraries store there credentials and read from them. You are going to have to make your own parser for that.

Linda Lawton - DaImTo
  • 106,405
  • 32
  • 180
  • 449