REST Server authentication?

So, if I’m using a web browser trying to hit the url of my 4D server that has REST enabled…
How could I enter a URL that would carry my authentication? (username & Password)

Likewise: if I was coding in 4D, using HTTP Request: are there one or more ways that I can build my authentication? via either http headers? or via URL?

I found https://developer.4d.com/docs/en/REST/authUsers.html#session-cookiethis>
But some links are dead (404). :-?

Yes: I read that page of the documentation very carefully, but it’s totally un-clear to me.
I tried constructing URL’s based on what I read: but none of them worked.

And some more informations https://doc.4d.com/4Dv18/4D/18/On-REST-Authentication-database-method.301-4505004.en.htmlhere>

Yes, Thanks,
I’ve also read, and am familiar with the On REST Authenticaiton database method. I’m using it: and for debugging: I can enable logging: so that I see what comes in, and if it’s being accepted.

I really need my original question answered of

  • If I wanted to use 4D’s “HTTP Request” command: would I add auth to the URL, or headers, or where?

Here are some more information about
https://developer.4d.com/docs/en/REST/directory.html$directory :The directory handles user access through REST requests.>

See the Login example; but it’s a session, https://forums.4d.com/Post/FR/32728435/2/33481735#33714538here> is more information (but in German) from Thomas

Manuel,
Thanks so much for your help.
I think I’m very very close.

I’m successfully posting a /rest/$directory/login call, using http headers to pass my username and password: and I see an http header that’s being returned the server with my cookie:
“Set-Cookie” = “WASID4D=67829FC6C143354488777AE69165E896; Path=/; Max-Age=3600; HttpOnly; Version=1”

Now, I’m trying to figure out exactly how to pass that cookie back on subsequent http requests:
I need to know the header name, and the header content.

Is the name “Set-Cookie”, or “Cookie”, or “WASID4D”, or what?

and then is the content “WASID4D={uuid}” or “{uuid}” or what?

Hi Tony,

How do you send your requests to the REST server ?

With the HTTP Request command ?

Marie,

How do you send your requests to the REST server ?

I’ve been trying to tell some outside parties how to connect to my database via the rest server.
To understand how to do it, and mock up an example for them, I’ve been using 4D’s HTTP Request command to mimic how other technologies would connect.

Now I understand that I think I would have found the answer: but it seems that the /rest/$directory/currentUser function was producing an error: and that was the command that I was using to see if my re-authentication was working.

I think the documentation about receiving the cookie AND how to pass it back to the server on subsequent requests need to be improved. It is NOT clear.

As per our discussion on the emails.
Here is an example that does what you need.
[]34357256;“Code example…”[/]