Carlos Cruz wants to merge 1 commit from /u/ccruz/allura/ to master, 2024-05-17
wiki-copy.py
script to support OAuth2 which also serves as an example of how to create a script using OAuth2 security and how to automatically refresh access tokensCommit | Date | |
---|---|---|
2024-05-13 21:46:37 | Tree |
revoke_token
should handle deleting a refresh token too. Not sure if we necessarily need it or not, but seems like the right thing to do according to https://oauthlib.readthedocs.io/en/latest/oauth2/validator.html?highlight=validate_refresh_token#oauthlib.oauth2.RequestValidator.revoke_token That says there's atoken_type_hint
to indicate which type of token it issave_bearer_token
you changed ac.user._id
to auser_id
determined by the request params. That seems good. Can you double check ifsave_authorization_code
should do that too? Or maybec.user
is correct if it is only called when a user is logged in and approving a client app?settings:
fields than what you have here./auth/oauth2/
should update that to/auth/oauth/
to match my merge request changes.test_run_precommit
has these errors:revoke_token
method since we already have our internal mechanism to revoke tokenssave_bearer_token
usesuser_id
because it's a public endpoint that doesn't require authentication so we attempt to fetch the user id depending on thegrant_type
instead than from the current context/auth/oauth2/
to/auth/oauth
inwiki-copy.py
confirm_redirect_url
in the OAuth2 validator to make sure that the same redirect uri the authorization code was created with, is also used when requesting an access tokenThere already is a
confirm_redirect_uri
and it has the same code :Din the api docs, you included
client_credentials
which does match what we have invalidate_grant_type
, but I'm wondering if we need it at all. Maybe in next merge request can decide if that is what we use for personal bearer tokens? Or if we don't need it, we should remove it entirely.