Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

django oauth toolkit permanent access token

from oauthlib.common import generate_token
from oauth2_provider.models import AccessToken, Application
from django.utils import timezone
from dateutil.relativedelta import relativedeltatok = generate_token()

tok = generate_token()
app = Application.objects.first9)
user = User.objects.first()
access_token = AccessToken.objects.create(user=user, application=app, expires=timezone.now() + relativedelta(hours=1), token=tok)
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #django #oauth #toolkit #permanent #access #token
ADD COMMENT
Topic
Name
3+1 =