Closed jer-tx closed 4 years ago
I think this is where examples / documentation would help a lot.
So, for now, maybe we can add all the OIDC parameters (and the missing OAuth 2 parameter) and just merge that.
So, for now, maybe we can add all the OIDC parameters (and the missing OAuth 2 parameter) and just merge that.
I can add all the OIDC params, which oauth2 param are you referring to?
I was referring to user
, which you added. And I think, yeah, we should add all those OIDC params while we're here. Thank you!
Actually, before I merge this (since it's been a little while), can you confirm for me that it's still possible to set request.client
, overriding the getter that add_oauth_param
installs if we list client
in this set?
As in, can we still set request.client
on the validator if client
exists in OAUTH_PARAMS
? yes that works. If I add config.add_oauth_param('client')
to config, I get a pyramid.exceptions.ConfigurationConflictError
error, which is probably intended behavior.
Thanks, I've been in JS-land so much lately I think I was thinking of Object.defineProperty()
making non-configurable properties (can't be reassigned/deleted). By adding a request property in Pyramid is not that invasive, so we're good.
Looking at the base
Request
class from oauthlib, I'm not sure it's 100% correct to addrequest.client
here. The request validator may use a custom sub-class ofClient
, for instance, that can load and persist its client_secret from a DB model.What's sort of surprising is that the documentation recommends setting
request.client
in theauthenticate_client
orauthenticate_client_id
methods of the request validator, but the error you posted in #18 seems to suggest that it's required.I think what's going on is that oauthlib is flexible, almost to a fault, here. If you were to implement custom grant types, they might not need
request.client
, but the built-in ones do (or at least, authorization_code does). Therefore, it's incumbent upon you to setrequest.client
to something useful to you (which may subclassClient
) if your grant types rely on it.