code: def create_id_token(token, user, aud, nonce='', at_hash='', request=None, scope=None):
      
      if scope is None:
          scope = []
      sub = settings.get('OIDC_IDTOKEN_SUB_GENERATOR', import_str=True)(user=user)
  
      expires_in = settings.get('OIDC_IDTOKEN_EXPIRE')
  
      # Convert datetimes into timestamps.
      now = int(time.time())
      iat_time = now
      exp_time = int(now + expires_in)
      user_auth_time = user.last_login or user.date_joined
      auth_time = int(dateformat.format(user_auth_time, 'U'))
  
      dic = {
          'iss': get_issuer(request=request),
          'sub': sub,
          'aud': str(aud),
          'exp': exp_time,
          'iat': iat_time,
          'auth_time': auth_time,
      }
  
      if nonce:
          dic['nonce'] = str(nonce)
  
      if at_hash:
          dic['at_hash'] = at_hash
  
      # Inlude (or not) user standard claims in the id_token.
      if settings.get('OIDC_IDTOKEN_INCLUDE_CLAIMS'):
          if settings.get('OIDC_EXTRA_SCOPE_CLAIMS'):
              custom_claims = settings.get('OIDC_EXTRA_SCOPE_CLAIMS', import_str=True)(token)
              claims = custom_claims.create_response_dic()
          else:
              claims = StandardScopeClaims(token).create_response_dic()
          dic.update(claims)
  
      dic = run_processing_hook(
          dic, 'OIDC_IDTOKEN_PROCESSING_HOOK',
          user=user, token=token, request=request)
  
      return dic
docs: Creates the id_token dictionary.
      See: http://openid.net/specs/openid-connect-core-1_0.html#IDToken
      Return a dic.