Unable to authenticate web app in SAFE Browser v0.16 alpha 2

The request to the SAFE Network App times out and no prompt is ever shown in the network app. It works exactly once (the very first time) and then after that no prompt is ever shown again.

I’m able to get the prompt to show by logging out and back in to the Network App, but this causes the browser to throw a NEON error (that we aren’t logged in to the authenticator).

At this point I’m essentially entirely blocked by this issue and unable to keep working, since I can’t get passed the auth_app call.

On a side note: What’s strange is that the entire javascript thread blocks even if I wrap the auth_app call in a promise or an async function using await. Is there something stopping the NEON functions from being called asynchronously? The entire page crashing while we wait for an authenticator response is a terrible user experience.

Can’t remember the details. (maybe @bochaco can). Neon wasn’t readily async. Thought they had plans to be updating as the full async/await syntax came for rust. Not sure of the status there atm.

But aye, they are decidely not async yet. Interesting it works only once. What version of SNAPP are you using @Shane?

I’ll carve out some time later today hopefully to look at this and get you un-blocked. (Meantime this branch is what will get merge into master next, it has some updates (latest safe-nodejs, so may be worth trying out in case it’s some safe-nodejs incompatibility with latest that’s in the browser alpha2).

2 Likes

That’s right, async bindings is not possible yet in Neon, so all functions are sync, but you should be able to put them behind a Promise yourself as you are trying to.

One workaround until the issue with auth notifications in the safe network app is solved, it’s using CLI to authorise it with safe auth reqs and safe auth allow commands.

2 Likes

Aha, so I can see this and the hang.

What version of SNAPP are you using @Shane? I can see the auth request in my SNAPP based off of this branch.

It is definitely blocking the thread though. I’ll have a look at wrapping this call to see if we cant get that behaving a bit better

1 Like

@joshuef I’m running version 0.0.5.584 on Windows 10, downloaded from here: https://github.com/maidsafe/safe-network-app/releases/tag/v0.0.5

1 Like

@joshuef been having more a mess around with it, if I accept the authentication request, I get the following error in my console:

api.js:15 Uncaught (in promise) Error: internal error in Neon module: Failed to authorise application: AuthError("Application was not authorised: InvalidInput(\"Failed to decode the credentials: EncodeDecodeError\")")
    at api.<anonymous> (api.js:15)
    at api.js:24
    at new Promise (<anonymous>)
    at api.promise (api.js:22)
    at api.authenticate (api.js:14)
    at <anonymous>:1:3
1 Like

Aye right. That’s an incompatibility between snapp and the browser safe version. I’ll get an update to SNAPP out asap.

In the mean time you can auth via the CLI instead of using snapp, and once logged in:

Let me know how you get on! :+1:

edit:

Oh aye, use cli: 0.8.1: https://github.com/maidsafe/safe-api/releases/tag/0.8.1

1 Like

Yep, I’ve been able to get that flow working, it’s a little clunky having to nip back in to the CLI every minute but it works.

I’m making auth_app requests in the SAFE Browser, running ./safe auth reqs then ./safe auth allow $REQUESTID in Powershell (I was using WSL\Bash, but I couldn’t seem to get the reqs to load in Linux when making them in the browser in Windows, so Powershell will have to do for now), and getting back a long string containing the auth request information.

Cheers for that, let me know when the next SNAPP version drops and I’ll alpha test it for you.

1 Like

@shane just to update you.

My working branch has the notification working. And is based off of the correct safe-cli version. If you build that manually, you’ll be going ina slightly neater fashion.

I’ve been working to get our tests updated after some changes, but I’m blocked from merging/building by our e2e test suite which has hit some libssl errors. As such I’m working on a branch of the cli (and some dependencies) to move away from libssl.

Until then though, I’d encourage you to have a go at building SNAPP. It’s just another electron / webpack app so you should get on okay (I think). But if you have any issues/need any help just let me know!

3 Likes

Cheers, I’ll build it tomorrow and have a fiddle.

1 Like

This topic was automatically closed after 60 days. New replies are no longer allowed.