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 tokens| Commit | Date | |
|---|---|---|
| 2024-05-13 21:46:37 | Tree |
revoke_tokenshould 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_hintto indicate which type of token it issave_bearer_tokenyou changed ac.user._idto auser_iddetermined by the request params. That seems good. Can you double check ifsave_authorization_codeshould do that too? Or maybec.useris 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_precommithas these errors:revoke_tokenmethod since we already have our internal mechanism to revoke tokenssave_bearer_tokenusesuser_idbecause it's a public endpoint that doesn't require authentication so we attempt to fetch the user id depending on thegrant_typeinstead than from the current context/auth/oauth2/to/auth/oauthinwiki-copy.pyconfirm_redirect_urlin 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_uriand it has the same code :Din the api docs, you included
client_credentialswhich 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.