Catching Auth response from Safe authenticatior.

Peruse browser has been deprecated and won’t work with the current SAFE API. Make sure you use the latest SAFE Browser from:

3 Likes

Wow things getting deprecated so fast. Ok so just tried with latest SAFE browser. But still we are unable to retrieve any response from network. :thinking:

@0mkara , I just ran your app and I can see at least four issues (apart from what @happybeing already pointed out, you need to use latest version of the browser since you are using safe-node-app package v0.11.x):

1- the browser is not telling you why the authorisation request you are sending is incorrect or malformed (issue #454). This is fixed already and will be part of the very next release of the browser to be available in the next few days, so stay tuned to downlod the new version when ready.

2- I assume you are trying with alpha2 network, since your package.json script start ("start": "cross-env NODE_ENV=production electron ./app/main.prod.js") is always starting it for alpha/real network and not for mock. Therefore if you are running a browser for mock, it won’t accept the authorisation request you are generating as it’s not for mock (here it’s where you should be receiving an error in the browser as I mentioned above for issue 454). If you want to generate auth request for mock you need to set NODE_ENV=test

3- your authorisation request is malformed since you are trying to request permissions for an invalid container, i.e. you are requesting permissions for public container instead of _public. If you change this the browser v0.12.x will show you the authorisation popup correctly. However, in this case the browser should handle the error too and it’s not, so I just raised issue #697 for the browser since the error should be sent back to the app as a response so it can hadle it properly.

4- you are not registering the app’s URI scheme for receiving the authorisation response, this is because you are setting registerScheme: false in here which should be set to true

6 Likes

Thank you very much for pointing out my mistakes. I will fix those and come back to the thread. :+1:

2 Likes

@0mkara also, just to be thorough, you need to ensure your electron app can do something with the passed URI once it is registered, please see @bochaco’s other post above.

The ipc message you were trying to use isn’t provided by default.

2 Likes

Are there any video tutorials for safe authentication process using electron-react ??

Hunter uses the cli authenticator in the Electron overview video here:

Thanks…