code: def create_token(user, client, scope, id_token_dic=None):
      
      token = Token()
      token.user = user
      token.client = client
      token.access_token = uuid.uuid4().hex
  
      if id_token_dic is not None:
          token.id_token = id_token_dic
  
      token.refresh_token = uuid.uuid4().hex
      token.expires_at = timezone.now() + timedelta(
          seconds=settings.get('OIDC_TOKEN_EXPIRE'))
      token.scope = scope
  
      return token
docs: Create and populate a Token object.
      Return a Token object.