Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

143
Vistas
How to get oauth2 client app from Django request

I'm using oauth2_provider + rest_framework. I have configured several client applications, and they successfully authenticate and receive access tokens.

I would like to have the client app in the request (Eg. request.client). Perhaps I should create some kind of middleware, which sets it, but I'm not sure what is the proper way to do it. Or maybe this functionality is already provided by the oauth2_provider/oauthlib, and I have overlooked it?

The client should be set when:

  • a valid access token is provided
  • valid app credentials are provided (like when requesting access token)

Python v3.5.3, Django v1.10.6

about 4 years ago · Santiago Trujillo
2 Respuestas
Responde la pregunta

0

oauth2_provider AccessToken has a foreign key to the application issued that token

You can get the application form the access token like this: application = request.auth.application

about 4 years ago · Santiago Trujillo Denunciar

0

AbstractApplication class has foreign key to settings.AUTH_USER_MODEL https://github.com/evonove/django-oauth-toolkit/blob/0.12.0/oauth2_provider/models.py#L62

So if you are using default Application class you could get the clients by request.user.oauth2_providers_applications

about 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda