koush / electron-chrome

Other
970 stars 68 forks source link

identity #25

Closed NdYAG closed 7 years ago

NdYAG commented 7 years ago

https://github.com/koush/electron-chrome/blob/master/chrome/api/chrome-identity/index.js#L215

It seems that the code here doesn't work for 3rd party OAuth identification

Maybe a better workaround is to use BrowserWindow to open the url.

const authWindow = new BrowserWindow(windowParams)
authWindow.loadURL(url)
authWindow.show()
safeRegister(remote.getCurrentWindow(), authWindow.webContents, (e, url) => {
  authCallback(null, url)
  setImmediate(function () {
    authWindow.close()
  })
}, 'will-navigate')
// register the same handler for `did-get-redirect-request` event
koush commented 7 years ago

what's your 3rd party oauth service? I only set tested/used this with google and left the other stuff stubbed out.

NdYAG commented 7 years ago

Hi @koush, It's OK. I find out that the workflow of each 3rd party might have minor differences. It might be better to leave this to developers than implementing a strategy for every one