Git Merge Request #415: oauth2 - combine preferences pages (merged)

Merging...

Merged

Something went wrong. Please, merge manually

Checking if merge is possible...

Something went wrong. Please, merge manually

Dave Brondsema wants to merge 4 commits from /u/brondsem/allura/ to master, 2024-05-20

things to check:

  • you see the apps you've created, and the authorizations you've granted, no more
  • security of endpoints are good (can't mess with something you don't own)
  • oauth1 still works fine
  • with the oauth2 ini setting disabled, you can't do oauth2 things

not done, would be nice in the future:

  • an oauth2 version of the oauth1 button to create a bearer token for yourself, where you DO see its value and it has no expiration
  • edit existing client apps (oauth1 never had this yet either!)
Commit Date  
[7584a7] (db/7272-settings) by Dave Brondsema Dave Brondsema

fixup! [#7272] combine oauth1 and oauth2 settings onto existing page, improve tests

2024-05-17 20:37:12 Tree
[0b5794] by Dave Brondsema Dave Brondsema

[#7272] small improvements

2024-05-14 22:13:45 Tree
[fb7199] by Dave Brondsema Dave Brondsema

[#7272] combine oauth1 and oauth2 settings onto existing page, improve tests

2024-05-08 20:37:13 Tree
[f94d3b] by Dave Brondsema Dave Brondsema

[#7272] convert HTML comments to jinja comments

2024-05-14 16:40:02 Tree

Discussion

  • Carlos Cruz - 2024-05-16
    • Got an AttributeError: access_token error when authenticating an API endpoint request using an access token, I think that's because of using request instead of req in rest.py:510
    • For some reason my UI froze when clicking the Register new application for OAuth2. I ended up clicking the button many times and when the UI was responsive again, it created multiple clients with the same name. Looks like UniqueOAuthApplicationName only validates against OAuth1 collections, so maybe should create an OAuth2 version?. That's if we're enforcing unique client names.
    • Probably we also want to enforce that the user inputs at least one redirect URL, they seem to be an important part of OAuth2 security-wise.
    • Should we display the Authorization Code and Access/Refresh tokens along with the client app information, in case the user for some reason loses those codes?
     
  • Dave Brondsema

    Dave Brondsema - 2024-05-16
    • good catch, I had this correct earlier but it didn't get merged properly so I had to redo it on this branch and missed that bit. Fixup pushed now.
    • hmm that is interesting. UniqueOAuthApplicationName checks globally so you couldn't have 2 clients named "test". Do we want this? The only reason I can think of is to prevent confusion if there are multiple people with "Zapier" clients, you might wonder which one is the "real" one? But you only see the authorization page for the client apps that you engage with, you'll never know if there's other ones or not. So I kinda think this is an unnecessary validation.
    • yea, maybe? The feedback I posted on your merge request is related to this too, if wiki-copy.py could be used without a redirect. Also what about when we generate personal bearer tokens? The OAuth1 approach has them derived from a client, so you'd have to make a client with a dummy redirect just to get a bearer token. Maybe we should make the process simpler and make the bearer token not even related to any client app at all? Not sure if that would work or not.
    • I was thinking we don't need to show codes & tokens to the user, since the user actually never sees them earlier either. It is the 3rd-party "client" is who gets those tokens and uses them. However! Once we start doing personal bearer tokens, we'll definitely want to show the token then. The oauth1 code has an is_bearer flag to know if the token is a personal one or one that a client app got authorized to use
     
  • Dave Brondsema

    Dave Brondsema - 2024-05-17

    I rebased against master and made one more fixup:

    • remove UniqueOAuthApplicationName usage within oauth2
    • make redirect URI required, since oauthlib seems to require it. In the rare case of something like wiki-copy.py which isn't a web app, they'll have to put something in, even if they don't use it.
     
  • Carlos Cruz - 2024-05-17

    All changes look good to merge.

     
  • Dillon Walls - 2024-05-20
    • Status: open --> merged
     

Log in to post a comment.