Recent

Author Topic: Implement rsql JWT  (Read 934 times)

cappe

  • Full Member
  • ***
  • Posts: 143
Implement rsql JWT
« on: April 02, 2021, 12:04:49 pm »
Can anyone tell me how to implement JWT security in RSQL, of which I am attaching the link of the project?

https://github.com/groupsc10/RSQL/

Gustavo 'Gus' Carreno

  • Hero Member
  • *****
  • Posts: 510
  • Professional amateur ;-P
Re: Implement rsql JWT
« Reply #1 on: April 02, 2021, 04:56:22 pm »
Hey Cappe,

That project already has a RSQL_Crypto_JWT.pas source file.
Can you provide more info of what you want?
It's not apparent from the very small amount of info you've given us, what you're asking for.

Cheers,
Gus
Lazarus 2.1.0(trunk) FPC 3.3.1(trunk) Ubuntu 20.10 64b Dark Theme
Lazarus 2.0.12(stable) FPC 3.2.0(stable) Ubuntu 20.10 64b Dark Theme
http://github.com/gcarreno

cappe

  • Full Member
  • ***
  • Posts: 143
Re: Implement rsql JWT
« Reply #2 on: April 03, 2021, 08:02:56 am »
Thank you for answering. The problem is how I pass the JWT object to TRSQLClient. I couldn't figure out how. Could you give me an example and also how to read it on TRSQLServer.

Thanks

Gustavo 'Gus' Carreno

  • Hero Member
  • *****
  • Posts: 510
  • Professional amateur ;-P
Re: Implement rsql JWT
« Reply #3 on: April 03, 2021, 08:13:50 am »
Hey Cappe,

Thank you for answering.

You are more than welcome!!

The problem is how I pass the JWT object to TRSQLClient. I couldn't figure out how. Could you give me an example and also how to read it on TRSQLServer.

Have you had a look under the folder demo?
Under that folder there are 3 other folders.
  • basic: Contains examples of a server and a client
  • db: Contains the sql script for the demos
  • jwt: Contains an example using the RSQL_Crypto_JWT.pas

That's where you'll find the examples you need.
Apart from that I can't help you since I've never used this code.

Cheers,
Gus
Lazarus 2.1.0(trunk) FPC 3.3.1(trunk) Ubuntu 20.10 64b Dark Theme
Lazarus 2.0.12(stable) FPC 3.2.0(stable) Ubuntu 20.10 64b Dark Theme
http://github.com/gcarreno

cappe

  • Full Member
  • ***
  • Posts: 143
Re: Implement rsql JWT
« Reply #4 on: April 03, 2021, 08:40:54 am »
The problem is how do I pass the object created with the RSQL_Crypto_JWT.pas example into TRSQLClient?

Gustavo 'Gus' Carreno

  • Hero Member
  • *****
  • Posts: 510
  • Professional amateur ;-P
Re: Implement rsql JWT
« Reply #5 on: April 03, 2021, 08:48:14 am »
Hey Cappe,

The problem is how do I pass the object created with the RSQL_Crypto_JWT.pas example into TRSQLClient?

Like I said, I've never used this code before.

But doesn't TRSQLClient have a property, maybe Body, where you can put the signed payload that comes from the JWT Crypto?

Try and find out...

Cheers,
Gus
Lazarus 2.1.0(trunk) FPC 3.3.1(trunk) Ubuntu 20.10 64b Dark Theme
Lazarus 2.0.12(stable) FPC 3.2.0(stable) Ubuntu 20.10 64b Dark Theme
http://github.com/gcarreno

cappe

  • Full Member
  • ***
  • Posts: 143
Re: Implement rsql JWT
« Reply #6 on: April 03, 2021, 09:35:10 am »
What you wrote doesn't help me

Gustavo 'Gus' Carreno

  • Hero Member
  • *****
  • Posts: 510
  • Professional amateur ;-P
Re: Implement rsql JWT
« Reply #7 on: April 03, 2021, 09:44:06 am »
Hey Cappe,

What you wrote doesn't help me

You're absolutely right, and I'm really sorry for that!

But I cannot also do all the work for you, can I.

If the author doesn't provide any documentation, you're only hope is the source, Luke... Or Obywan Kenobi... Depends whom you ask :P

Cheers,
Gus
Lazarus 2.1.0(trunk) FPC 3.3.1(trunk) Ubuntu 20.10 64b Dark Theme
Lazarus 2.0.12(stable) FPC 3.2.0(stable) Ubuntu 20.10 64b Dark Theme
http://github.com/gcarreno

cappe

  • Full Member
  • ***
  • Posts: 143
Re: Implement rsql JWT
« Reply #8 on: April 03, 2021, 09:51:13 am »
To tell the truth something I would have been able to do, but I changed the source, so it is no longer the original project. I wanted to know how the author intended, I can't understand it.

jcmontherock

  • Jr. Member
  • **
  • Posts: 67
Re: Implement rsql JWT
« Reply #9 on: April 03, 2021, 11:31:48 am »
Try to contact Groupo SC10...

cappe

  • Full Member
  • ***
  • Posts: 143
Re: Implement rsql JWT
« Reply #10 on: April 03, 2021, 11:50:16 am »
Thanks for the answer, but where can I find the Groupo SC10?

Leledumbo

  • Hero Member
  • *****
  • Posts: 8326
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: Implement rsql JWT
« Reply #11 on: April 03, 2021, 02:43:59 pm »
Thanks for the answer, but where can I find the Groupo SC10?
You're trying to use something from github, every github project belongs to a user. The bold part in https://github.com/groupsc10/RSQL/ is the user, you can contact directly in github through issues page.
The problem is how do I pass the object created with the RSQL_Crypto_JWT.pas example into TRSQLClient?
As for your inability to understand an undocumented, let alone it's an ALPHA quality project with high chance of API change (the author has warned you in the README.md), the answer is you don't. The JWT handling is part of the extended fphttpapp server in RSQL_Server_Application unit. You use that server, you get JWT protected routes to access the DBMS, details in RSQL_Server_Router unit.

cappe

  • Full Member
  • ***
  • Posts: 143
Re: Implement rsql JWT
« Reply #12 on: April 03, 2021, 02:52:57 pm »
Ok. Another question, to enable SSL, I have selected useSSL in both the connector and the server, but it doesn't work. Do I have to do something else?

 

TinyPortal © 2005-2018