pocketbase icon indicating copy to clipboard operation
pocketbase copied to clipboard

support for chrome apps (extentions) OAuth 2

Open whateverneveranywhere opened this issue 3 years ago • 0 comments

Hey there!

first of all. thanks for the amazing product. been a rocket launcher in terms of how much boost it added to my side projects!

one limitation I noticed recently, using manifest v3 and the latest chrome extension APIs as of today, the flow is done using chrome.identity.getAuthToken({ interactive: true, }) an in-browser popup to log in with a google account, and if you check google's cloud console, it is a requirement to specifically use "chrome app" to get a client ID for OAuth 2 if the project is a chrome extension.

image

however, using the method offered in javascript's SDK using pb.collection('users').authWithOAuth2 there is multiple stuff that is required by design but isn't compatible with this flow.

image

for example, in the panel, when using a chrome app, there is no need for a client secret but it's a required field and later on, the need for a callback URL for when the process was successful, is nothing that should be forced since this flow may fully happen just in the browser and in the extension's popup.

image

I'm not sure if there's a workaround for this at this moment, but would really appreciate it if this could be considered as a feature sometime in the future.

Again, thank you so much for the awesome project <3

whateverneveranywhere avatar Feb 22 '23 17:02 whateverneveranywhere