Recent

Author Topic: These days, Lazarus feels old und unmodern ... API authentication  (Read 1101 times)

xint

  • New Member
  • *
  • Posts: 33
I need to be authentic to an API with a “ bearer secret”, and for all “modern” languages there are SDKs and libraries that handle this seamlessly. The previous API my client used came with username and secret, which took me an hour to read, understand and implement.
But now I wasted almost my whole day authenticating with a bearer secret with no success. I've read, installed and tried so much - does it really have to be that complicated with Lazarus !?

MarkMLl

  • Hero Member
  • *****
  • Posts: 8551
Re: These days, Lazarus feels old und unmodern ... API authentication
« Reply #1 on: February 20, 2025, 02:10:03 pm »
In that case why don't you take the trouble to tell us what you're trying to do? What API, what OS, what version of Lazarus etc... as well as what you've tried and what went wrong.

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Logitech, TopSpeed & FTL Modula-2 on bare metal (Z80, '286 protected mode).
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

Warfley

  • Hero Member
  • *****
  • Posts: 2040
Re: These days, Lazarus feels old und unmodern ... API authentication
« Reply #2 on: February 20, 2025, 07:46:57 pm »
Bearer tokens are just a type of Authorization header. You can set it using FPHttpClient with a single line of code:
Code: Pascal  [Select][+][-]
  1. httpclient.AddHeader('Authorization', 'Bearer ' + token);

What do you need an SDK for?

Joanna

  • Hero Member
  • *****
  • Posts: 1419
Re: These days, Lazarus feels old und unmodern ... API authentication
« Reply #3 on: February 20, 2025, 11:20:42 pm »
Quote
These days, Lazarus feels old und unmodern ..
Oh dear, that’s horrible! Lazarus was written just for you, you should ask for your money back!   :o

silvercoder70

  • Full Member
  • ***
  • Posts: 200
    • Tim Coates
🔥 Pascal Isn’t Dead -> See What It Can Do: @silvercoder70 on YouTube

 

TinyPortal © 2005-2018