NetTalk Central

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Jane

Pages: [1] 2 3 ... 27
1
The one system I've got in production doing that, Johan, I wrote 7+ years ago and did my own thing rather than whatever OAuth was available at that time.
It's been working fine since.
I guess the question would be whether each of your customers has his own credentials, or whether you are contacting the API as you.
I think a lot of the rationale for OAuth is when you're acting on behalf of somebody else.  In my app, that's not the case.

I have two generic procedures:
1. Checks the expiration of my existing token. Fetches a new token if the old one is within 5 minutes of expiry.
2. General API-calling NetTalk client.  It's called by something else.  It gets a token from the check-and-update-if-needed token procedure, then fills a StringTheory object with what's received from the API.

Then I have various procedures for individual API endpoints I need.
Each procedure constructs the URL with its parameters list.  Then passes the URL, a String Theory object, and anything else needed to the api-calling procedure.  When the latter has completed, the procedure parses the String Theory object and does its thing.

I posted more details a while back.
NOTE:  I've fixed this code since then. 
Instead of the custom header I was using in that old post, I now use ThisWebClient.Authorization

Code: [Select]
!    ThisWebClient.CustomHeader = 'Authorization: Bearer '&clip(pToken) !changed to ThisWebClient.Authorization 12/31/2024
    ThisWebClient.Authorization = 'Bearer ' & clip(pToken)

https://www.nettalkcentral.com/forum/index.php?topic=9562.msg39234#msg39234


2
Quote
Sv should opena Discord server !!!

Bruce has created one.  It's fairly active.

3
Confirming that I get the same error as David with driver kit 1.06 and NT 14.34.

Updating a record in the Movies desktop example app from the driver kit works fine, but David's NetTalk form complains of duplicate key.

I didn't chase any further.


4
Web Server - Ask For Help / Re: Let's Encrypt issues
« on: August 05, 2025, 12:05:44 PM »
That's what it looks like to me, Jeff.
 
If you click the "Notify Server Challenge is Ready" link from your log https://acme-staging-v02.api.letsencrypt.org/acme/chall/218067634/18813677063/luoqhA

It says... 
  "error": {
    "type": "urn:ietf:params:acme:error:connection",
    "detail": "131.247.221.208: Fetching http://bcdb.usfbreastresearch.org/.well-known/acme-challenge/0XtYAnuLqEvkaYcPwYxNTwSqiGltTG172l_VnoY7Ac0: Timeout during connect (likely firewall problem)",
    "status": 400

5
Web Server - Ask For Help / Re: How to debug this slow request?
« on: August 02, 2025, 05:02:21 PM »
I watched the webinar recording, Johan.

Helpful hint - Ctrl+Shift+X clears the log in debugview++

6
Web Server - Ask For Help / Re: How to debug this slow request?
« on: July 30, 2025, 07:12:20 AM »
Hi, Johan,
Not sure I'm understanding?  Do you have a browse with an EIP column and the browse itself is slow to load?

Is the browse page-loaded or file-loaded? How many items are in the EIP dropdown list?

I think that the browse with EIP populates all the EIP possibilities for the column for each row.  Which, if you have 15 rows in the browse, would mean it needs to process all of the rows for the EIP selections 15 times.  If file-loaded, then for the entire browse.  If you only have a few choices that might be reasonable, but if there's a long list there will be a lot of overhead.

When you use an update form, the EIP selections are only populated once when you open the form.


7
Web Server - Ask For Help / Re: Problem running from localhost
« on: July 18, 2025, 11:10:08 AM »
As a guess, your browser has decided to connect with TLS.
If you copy the address from the browser address bar and paste it into notepad, to you see http:// or https://  ?

Also try compiling the netdemo program and use its web client to verify that you can connect to your app with http


8
I don't know, Mike.

I suppose you could either
1. specify https://
2. set OptionDontRedirectHTTPtoHTTPS to FALSE

But you do realize that Obi Wan is nagging you - and deliberately put that error onto line 1780 in NetWww.clw  ;)

There's code in the few lines preceding that where he decides how to deal with something that doesn't have http:// or https://


9
The Themer example has code in the PageHeader xml to display the *current* theme using <!-- Net:s:_theme_ -->

But to get the default, you could try using  p_web.WebServer._SitesQueue.Defaults.DefaultTheme
   

11
Web Server - Ask For Help / Re: Webclient with certificat
« on: May 09, 2025, 04:48:09 PM »
ACK!
Sorry, Niels.  I thought I had edited those question-marks-that-should-be-dashes.

I pasted text from a PDF I did for a ClarionLive webinar some years back and the rogue question marks blossomed. 

Anyway, I hope you got it working.

Cheers,

Jane

12
Web Server - Ask For Help / Re: Webclient with certificat
« on: May 08, 2025, 08:44:44 PM »
Net demo web client is great for testing.
I don't think you'll be able to make it work with the PFX, though.
A PFX contains both the certificate (with its public key) and your secret private key.  And it's password-protected.

To split apart a PFX for use with NetTalk, use openssl (it's installed automatically with any of your netweb server projects).

When you use openssl, the first private key file you'll get will be password-protected. 
You can also run one more openssl command to produce an unencrypted private key file.

Code: [Select]
Openssl pkcs12 -in MyDomain.pfx -nocerts -out MyDomainEncrypted.key
Openssl rsa -in MyDomainEncrypted.key -out MyUnencryptedDomain.key
Openssl pkcs12 -in MyDomain.pfx -clcerts -nokeys -out MyDomain.crt

13
Web Server - Ask For Help / Re: How to adjust font size NT Variable
« on: May 04, 2025, 03:52:45 PM »
Hi, Ron,
Variables were the heart of themes and the "themer" app that Bruce introduced in (NT12??). 
The idea being that you can set something (a color, font size, button radius, etc.) in one place and have the entire web app use those settings.

14
Web Server - Ask For Help / Re: NetWebServiceMethod as REST - HOW?
« on: May 04, 2025, 03:51:07 PM »
Are you making an API client or API server?
Can you post the exact spec of what you're trying to do?

15
Web Server - Ask For Help / Re: NetWebServiceMethod as REST - HOW?
« on: May 03, 2025, 12:03:39 PM »
You can do a REST API without relying on a single REST ID to call it, Niels.

There are plenty of REST APIs I call with multiple parameters, such as
api.whatever.com/v2/appointments/booked?showpatientdetail=false&patientid=1&showcancelled=true&providerid=162

Pages: [1] 2 3 ... 27