You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the case of Implicit or Authorization Code grants, the external introspected username is potentially added to the UserModel here if it doesn't already exist:
Should the external introspected client_id also cause a similar thing to happen, creating an Application instance if one is not defined?
Currently, because AccessToken.application is None, there is no consistent way to identify which OAuth2 Client was used. If the internal introspection server was used, application is set but if the external introspection server was used, application is not.
This is especially a concern when the Client Credentials grant type is used as there is no user.
Would it break anything to dummy up an application instance in a manner similar to what is currently done for user? Something along these lines right around the same lines referenced above:
application, _created=Application.objects.get_or_create(
client_id=content["client_id"],
user=None,
redirect_uris="",
client_type="Public",
authorization_grant_type="", # what to put here?client_secret="",
name=content["client_id"],
)
The text was updated successfully, but these errors were encountered:
A workaround is to assign each Client Credentials client a unique scope in the external OAuth2 AS that only it is allowed to request and to check for that scope in TokenMatchesOASRequirements
If the introspection endpoint is external (not using
oauth2_provider
as the OAuth 2 AS) theapplication
gets set to None here:django-oauth-toolkit/oauth2_provider/oauth2_validators.py
Lines 335 to 344 in 5b51da7
In the case of Implicit or Authorization Code grants, the external introspected
username
is potentially added to theUserModel
here if it doesn't already exist:django-oauth-toolkit/oauth2_provider/oauth2_validators.py
Lines 313 to 317 in 5b51da7
Should the external introspected
client_id
also cause a similar thing to happen, creating anApplication
instance if one is not defined?Currently, because
AccessToken.application
is None, there is no consistent way to identify which OAuth2 Client was used. If the internal introspection server was used,application
is set but if the external introspection server was used,application
is not.This is especially a concern when the Client Credentials grant type is used as there is no
user
.Would it break anything to dummy up an application instance in a manner similar to what is currently done for user? Something along these lines right around the same lines referenced above:
The text was updated successfully, but these errors were encountered: