"APP ZERO": Beginners SAFE Web App Tutorial

Looks like it’s not authorising - does it just hang there?

1 Like

Yes.

[AUTO-UPDATE] Error: Disabled. Only available on macOS and Windows.

Above is part of the terminal output. I’m using Linux, could this be why?

1 Like

I don’t think so. I’m trying on Ubuntu now and am getting the same thing. From experience it’s pretty hit and miss - I’ll try on Debian see if I can get it going on that.
EDIT: Nope - same thing happens on Debian. Only works on Windows for me.

1 Like

Sorry if this is a daft question, but did you authorise it (in the browser you should see a request for authorisation)?

Looks like that might be the case for @folaht. For me at least (in Ubuntu) the authenticator does not even recognise the web_hosting_manager. I’ve had this happen before, it seems to be quite fussy.

2 Likes

Yes, that’s why safe_hosting_manager is in Authorised applications.

Ah sorry, wasn’t paying enough attention :slight_smile: I had the same intermittently when doing self build of these from the Dev branch (linked to earlier). It did get past this once or twice though, but not much further. Still seems buggy, so it may be worth reporting on github.com as an issue.

1 Like

OK - so long as it has got to the next stage from your screenshot above - ie authentication was successful - the next stage is easy, unless I’m missing something. Assuming you have a website folder ready - or just a simple index.html file - do the following.

EDIT: On re-reading the thread I realise I’m probably teaching granny to suck eggs. :blush: Hopefully useful for someone though!

  1. Create a public ID (e.g. mine is jpl1)

  1. Create a service name (mine is test) and select the default option to Create Service.

  2. Click on the URL (e.g. _public/jpl1/test-root)

  3. Navigate to the website directory on your PC - or the file if it’s just an index.html - and upload it.

  4. In the browser navigate to the site (e.g. safe://test.jpl1)

2 Likes

How do you get to the public ID page?

When you authorise wsm, the wsm window shows options. But my understanding is that it is stuck saying “Waiting for authorisation” - am I correct - so you won’t see any commands there?

I had the same symptom, but think it got further once I installed all the prerequisites maybe that’s your problem? Seems unlikely if you are using binaries, but worth a try!

2 Likes

I’ll try installing the prereqisuisites.

I wonder what has changed? When the authenticator functionality was in the Launcher it used to connect with apps (e.g the Demo App) without a hitch, but now that it’s bundled with the browser it is very hit and miss - mostly miss from my experience.

1 Like

A lot. Before the launcher act as filter from the Apps. Now the system is different and the core must do the work.

The best is read the RFC.

2 Likes

Ah yes, I think I sort of vaguely knew about this once upon a time. So in summary:

The Launcher as a central authentication gateway was not a suitable solution for mobile and other limited resource devices.

Instead the authentication responsibilities are now split between the app and the Authenticator, which is bundled with the browser. This is done by integrating parts of safe_core into each.

Each app now interacts with the network independently, with the Authenticator acting as an app manager. The app connects with the network using credentials derived from a combination of the user’s key and the app’s own unique keys, while the Authenticator requests, grants and stores these permissions.

Once permission for an app to access network resources has been granted by the user, these permissions persist until changed or revoked by the user. Thus there is no need for each app to login again every time.

So if I have understood correctly the current unreliability presumably has something to do with the way the two ‘halves’ of safe_core are talking to each other and this is somehow sensitive to the particular OS / environment. Would this mean more dependencies will need to be bundled into future releases?

2 Likes

I tried installing it, same result.

But at least I know I’m not supposed to see “Waiting for authorisation” after the SAFE Browser has added the app.

2 Likes

#A0 Updated for Authenticator!!

Also has this extended version that I’m working on, that aims to have all of the functions in the docs covered and organized neatly. Love the new docs by the way, @maidsafe @bochaco etc!! They are super clean and easy to use. The DOM code examples are awesome!!

If you need help using the code, my most recent tutorial vid walks you through everything you need to know to try this code out right now! Enjoy

3 Likes

Looking into app zero python source code I see:

url = 'http://localhost:8100/auth'

And if I understand everything correctly, this needs to be uploaded into a public container.

But before that happens a public ID needs to be created and that’s done on a test net.
Why is the creation of a public ID done only possible on a test net and not optionally locally?

1 Like

Everything, including public IDs, is stored on the network so you can’t do it locally.

The localhost there is only a local bridge to the API in Launcher (now deprecated) which then processes the auth request which involves network access.

3 Likes

So registring public IDs depends on centralized computers?
Why can’t this be done locally?

[Edit]

I see you’ve answered this question in another thread. I’ll take a look at safe_vault.

[/Edit]

1 Like

Not at all. The network has no central servers. You register the ID with the network. This can’t be local or more than one person could register the same ID. Hope that helps.

1 Like