wagnerdelima / drf-social-oauth2

drf-social-oauth2 makes it easy to integrate Django social authentication with major OAuth2 providers, i.e., Facebook, Twitter, Google, etc.
https://drf-social-oauth2.readthedocs.io/en/latest/
MIT License
269 stars 34 forks source link

500 Character limit exceeded #187

Closed kaushikaryan04 closed 1 year ago

kaushikaryan04 commented 1 year ago

I get this error when I try to convert the google token to drf access token ( convert-token )

I was using the older version of the library. Since I updated the package (To the latest one ) I have been getting this error

{"token":["Ensure this field has no more than 500 characters."]}%

The reason I updated was because I was facing another bug and someone suggested to update.

This is the curl command I ran curl -X POST -d "grant_type=convert_token&client_id=xxxxxxxxxxxxxxxxx&client_secret=xxxxxxxxxxxxxxx&backend=google-oauth2&token=eyJhbGciOiJSUzI1NiIsImtpZCI6IjYwODNkZDU5ODE2NzNmNjYxZmRlOWRhZTY0NmI2ZjAzODBhMDE0NWMiLCJ0eXAiOiJKV1QifQ.eyJpc3MiOiJodHRwczovL2FjY291bnRzLmdvb2dsZS5jb20iLCJuYmYiOjE2ODU4MjIwOTMsImF1ZCI6IjU4NDcwODczNTcxNy0xZnYycmRjYWduZnVtczRzYm0xNjJzY3MzNzI1dGo1Ni5hcHBzLmdvb2dsZXVzZXJjb250ZW50LmNvbSIsInN1YiI6IjEwNzMwNDAwMzkxMzQzMTYxOTA2NCIsImVtYWlsIjoia2lsbGVycHViZzgxQGdtYWlsLmNvbSIsImVtYWlsX3ZlcmlmaWVkIjp0cnVlLCJhenAiOiI1ODQ3MDg3MzU3MTctMWZ2MnJkY2FnbmZ1bXM0c2JtMTYyc2NzMzcyNXRqNTYuYXBwcy5nb29nbGV1c2VyY29udGVudC5jb20iLCJuYW1lIjoiUFVCRyBLSUxMRVIiLCJwaWN0dXJlIjoiaHR0cHM6Ly9saDMuZ29vZ2xldXNlcmNvbnRlbnQuY29tL2EvQUFjSFR0ZGlnVUlmSXBfS1dQTVJyV2xhRmk1LUVUYjRxWTNzejl1Tld4bXA9czk2LWMiLCJnaXZlbl9uYW1lIjoiUFVCRyIsImZhbWlseV9uYW1lIjoiS0lMTEVSIiwiaWF0IjoxNjg1ODIyMzkzLCJleHAiOjE2ODU4MjU5OTMsImp0aSI6ImRjNmI2MGFjYjZmNTQyMjdhODlhZDljNDIyNTNjYjc2OWJkNTk3MzAifQ.UKCiBUGMNQ_8qk7npz8Iycjx4IbOmWoHJiGeA1cxdS65tiUKUEIW_Jzn5kA7gcZAaNMS1GgPva9BXEuM_cCYoJrM2y0CdIU-pwZicb254y6WJ05Y9FnOL176G1-StprOXn1qS5xu2nvzxWjD6QYVQZgHpDBgo3zEEotkntbPUNJu3OQwKp8QD3qfP7BB66QNkqfieLh7boVgLUWa6LQNEkfVVGXf9rSLgSqXbNPoP5btQoEPEEWt71bkISMZa_7B_8Y7uRBP2UepRC-aZ_XyzWG9y5u0F9LJmG9-VKFuNibP6fA0pPKPSBu-w9Mcow4Wo7SWnbmsVT9TT5VbgM4rVA" http://localhost:8000/auth/convert-token

The token is exceeding 500 character but it cannot be controlled google gives this.

Is there something I am doing wrong or is it a bug.

wagnerdelima commented 1 year ago

@kaushikaryan04 yes you could call that a bug. The serializer has 500 set as max length in the token field.

Please use the latest version of the framework: https://pypi.org/project/drf-social-oauth2/2.1.3/.

kaushikaryan04 commented 1 year ago

Oh okay thanks for the fix.