#6218 Use extension-specific oauth redirect url#6219
Conversation
sosnovsky
left a comment
There was a problem hiding this comment.
Hi @martgil, a lot of tests are failing because local dev extension builds use dynamic extension id. Maybe there is some way to use fixed id for local builds, so we can add this id to the list of allowed redirect URIs for our OAuth app.
|
You're correct, Roma. I'll look for some other alternative. |
|
Hello @sosnovsky - Just a quick question. The Mozilla Firefox extension id has also this dynamically generated id, does this means, the extension id for both builds should matches exactly identical? Or does the Mozilla firefox build has to had the static extension id too? |
|
|
|
also firefox uses |
|
Got it - thanks! |
|
Hello @sosnovsky - I have managed to make a static extension id from which the current one we have on this PR is |
|
is this certificate required for creating local builds? if no, then there is no need to put it in the repository |
Edit: No, it is not required for creating the local builds. Thanks for your answer.
Got it - will do. |
|
Hi @sosnovsky - May I here your feedback on this one, please? I may have missed important ones. |
| }, | ||
| { | ||
| "matches": ["https://www.google.com/robots.txt*"], | ||
| "matches": ["https://www.google.com/oauth2/callback*"], |
There was a problem hiding this comment.
it'll probably won't work, as we now use extension id specific redirect URIs, and https://www.google.com/oauth2/callback won't be called causing auth process stuck.
I also re-checked launchWebAuthFlow documentation, and looks like it should work with our current OAuth Client ID, so users won't need to re-authenticate and their current refresh tokens will stay valid. Also switching to launchWebAuthFlow will allow us to remove a lot of our custom OAuth code (like oauth2_inject.ts, oauth2_finish.ts etc).
So let's try to migrate auth to launchWebAuthFlow, hopefully it won't require a lot of code changes and we already have it implemented in ConfiguredIdpOAuth, so you can re-use some code from it.
There was a problem hiding this comment.
Thanks Roma. I have followed your suggestions. It doesn't seem to have required alot of code changes. Can you please give it another check?
… redundant redirect URI check
…idation accordingly
|
Hi @sosnovsky - I have manually tested it on Firefox and it works well now. Then tests for the chrome build have passed too. Feel free to re-check at your convenience. |
sosnovsky
left a comment
There was a problem hiding this comment.
works great now, well done 👍
| } | ||
| return chrome.identity.getRedirectURL('oauth'); | ||
| const redirectUri = chrome.identity.getRedirectURL('oauth'); | ||
| if (navigator.userAgent.includes('Firefox')) { |
There was a problem hiding this comment.
let's use existing Catch.isFirefox() check
This PR replaces the Google robots.txt redirect URL to extension specific oauth redirect URL.
Closes #6218
Tests (delete all except exactly one):
To be filled by reviewers
I have reviewed that this PR... (tick whichever items you personally focused on during this review):