I am new to Django OAuth Toolkit. I want to customize the authenticate response.
My authenticate url configuration on django application is :
url('authenticate/',
include('oauth2_provider.urls', namespace='oauth2_provider'))
https://django-oauth-toolkit.readthedocs.io/en/latest/install.html
Now, when i launch this command :
curl -X POST -d 'grant_type=password&username=$username&password=$password'
-u "$client_id:$client_secret" http://127.0.0.1:8000/authenticate/token/
I get this response :
{
"access_token": "ATiM10L0LNaldJPk12drXCjbhoeDR8",
"expires_in": 36000,
"refresh_token": "II4UBhXhpVDEKWmsUQxDzkj3OMjW1p",
"scope": "read groups write",
"token_type": "Bearer"
}
And would like this response :
{
"access_token": "ATiM10L0LNaldJPk12drXCjbhoeDR8",
"expires_in": 36000,
"refresh_token": "II4UBhXhpVDEKWmsUQxDzkj3OMjW1p",
"scope": "read groups write",
"token_type": "Bearer",
"member": {
"id": 1,
"username": "username",
"email": "email@gmail.com",
....
}
}
I just want to override this response for add information of authenticated user. I have read the documentation of django-oauth-toolkit. And i didn't find a solution to my problem...