I have been working on a new electron app with react that uses the Spotify API. I am using oAuth to authenticate with Spotify and a return an access token, this why fine in a lo
You can register custom protocol and intercept it via electron so that you dont require a web server. you may set the urn of the native desktop/mobile application instead of redirect uri of the web app.
https://electronjs.org/docs/api/protocol
protocol.registerFileProtocol('yourprotocolname', (request, callback) => {
//parse authorization code from request
}, (error) => {
if (error) console.error('Failed to register protocol')
})
Set the urn of the application in the oauth configuration as yourprotocolname://example