Recent

Author Topic: These days, Lazarus feels old und unmodern ... API authentication  (Read 735 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: 8379
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: 1872
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 from IRC

  • Hero Member
  • *****
  • Posts: 1362
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
✨ 🙋🏻‍♀️ More Pascal enthusiasts are needed on IRC .. https://libera.chat/guides/ IRC.LIBERA.CHAT  Ports [6667 plaintext ] or [6697 secure] channel #fpc  #pascal Please private Message me if you have any questions or need assistance. 💁🏻‍♀️

silvercoder70

  • Full Member
  • ***
  • Posts: 166
    • Tim Coates
Explore the beauty of modern Pascal programming with Delphi & Free Pascal - https://www.youtube.com/@silvercoder70

 

TinyPortal © 2005-2018