Recent

Author Topic: An OAuth2 Client for Lazarus  (Read 3134 times)

tonyw

  • Sr. Member
  • ****
  • Posts: 321
    • MWA Software
An OAuth2 Client for Lazarus
« on: August 23, 2021, 12:42:10 pm »
I have uploaded to github an RFC 6749 OAuth2 Client implemented as a Lazarus Package. OAuth2 is an increasingly popular authorization protocol and is used, for example, by many Google APIs.

The client is intended to be fully featured and supports the following grant types:
    • Authorization Code Grant
    • Implicit Grant
    • Resource Owner Password Credentials Grant
    • Client Credentials Grant.

Attention has also been paid to extensibility. The client also provides:
    • A means of implementing an Extension Grant, including new grant types.
    • Support for new token types
    • Support for New Endpoint Parameters, and
    • Support for additional error codes.

This OAuth2 Client uses an external User Agent - the System Web Browser - and incorporates in internal http server for handling redirect responses from an Authorization Server.

The package uses the Indy Component library for both an http/https client and an http server. When the https protocol is used the OpenSSL library must also be installed and available for use.

Multithreading support is required for Authorization Code and Implicit Grants.

The package is written in Object Pascal and is made available under the Lesser GPL. A comprehensive User Guide is also available. It may be downloaded from

https://github.com/MWASoftware/oauth2client

Gustavo 'Gus' Carreno

  • Hero Member
  • *****
  • Posts: 1119
  • Professional amateur ;-P
Re: An OAuth2 Client for Lazarus
« Reply #1 on: August 23, 2021, 01:48:50 pm »
Hey Tony,

Many thanks for sharing this to the major public.

I'll be sending some PRs your way, cuz, you know, I'm a very old fart and I need some order in the software I admire the most :) :P

Nonetheless, it does not diminish your wonderful contribution to the Object Pascal community, on the contrary, I like it so much that I want to buff it until is shines above the rest :)

Cheers,
Gus
Lazarus 3.99(main) FPC 3.3.1(main) Ubuntu 23.10 64b Dark Theme
Lazarus 3.0.0(stable) FPC 3.2.2(stable) Ubuntu 23.10 64b Dark Theme
http://github.com/gcarreno

tonyw

  • Sr. Member
  • ****
  • Posts: 321
    • MWA Software
Re: An OAuth2 Client for Lazarus
« Reply #2 on: August 23, 2021, 02:51:04 pm »
Thank you Gus and Alexey T for the useful pull requests. I have accepted them.

This is the first time I have published to github, so the suggestions are very useful.

Tony

Gustavo 'Gus' Carreno

  • Hero Member
  • *****
  • Posts: 1119
  • Professional amateur ;-P
Re: An OAuth2 Client for Lazarus
« Reply #3 on: August 23, 2021, 03:07:29 pm »
Hey Tony,

Thank you Gus and Alexey T for the useful pull requests. I have accepted them.

This is the first time I have published to github, so the suggestions are very useful.

Tony

You're more than welcome!!

I'm gonna drop an issue or two about the binary files that you've included and are not necessary for the completeness of the code.
Mainly it should be any *.res file. This is automatically rebuilt upon every build/compile and being a binary file should not be included in the repository.
The .gitignore file already ignores it, now you should remove it with the git rm command. I'll drop the specifics on the Issue.

I'll then see if you've included any *.lps files. These are your local Lazarus Project/Program Session and it's personal. It's not a binary file but it contains personal info that might not be suitable for the public.
The file glob is included on the .gitignore already, just need to see if you've included any on the example folder and then give you the details on how to git rmove them on an issue.

After that, I would suggest that all binaries should be dropped under a folder bin at the top most level of the repo. If you agree with that I'll do the changes and submit a PR.

At last, I'm proposing having 3 Build Modes, the Default one, the Debug one and the Release one. If you agree to that, I'll also make the necessary changes and submit a PR.

Again, many thanks for the time spent in getting this to us all!!

Cheers,
Gus
Lazarus 3.99(main) FPC 3.3.1(main) Ubuntu 23.10 64b Dark Theme
Lazarus 3.0.0(stable) FPC 3.2.2(stable) Ubuntu 23.10 64b Dark Theme
http://github.com/gcarreno

tonyw

  • Sr. Member
  • ****
  • Posts: 321
    • MWA Software
Re: An OAuth2 Client for Lazarus
« Reply #4 on: August 23, 2021, 03:55:53 pm »
Hey Tony,

Thank you Gus and Alexey T for the useful pull requests. I have accepted them.

This is the first time I have published to github, so the suggestions are very useful.

Tony

You're more than welcome!!

I'm gonna drop an issue or two about the binary files that you've included and are not necessary for the completeness of the code.
Mainly it should be any *.res file. This is automatically rebuilt upon every build/compile and being a binary file should not be included in the repository.
The .gitignore file already ignores it, now you should remove it with the git rm command. I'll drop the specifics on the Issue.

I'll then see if you've included any *.lps files. These are your local Lazarus Project/Program Session and it's personal. It's not a binary file but it contains personal info that might not be suitable for the public.
The file glob is included on the .gitignore already, just need to see if you've included any on the example folder and then give you the details on how to git rmove them on an issue.
I had already caught the .lps and have now removed the .res.

After that, I would suggest that all binaries should be dropped under a folder bin at the top most level of the repo. If you agree with that I'll do the changes and submit a PR.
There should not be any binaries other than .ico file in the gui example. That could go.

At last, I'm proposing having 3 Build Modes, the Default one, the Debug one and the Release one. If you agree to that, I'll also make the necessary changes and submit a PR.
Feel free to do do. I tend not to bother myself - I use scripts and makefile.fpc to build production version.


Again, many thanks for the time spent in getting this to us all!!

Cheers,
Gus

tonyw

  • Sr. Member
  • ****
  • Posts: 321
    • MWA Software
Re: An OAuth2 Client for Lazarus
« Reply #5 on: August 23, 2021, 03:57:13 pm »
I have updated the code on Github to include Alexey T's suggestion to increase the uniqueness of global identifiers. The User Guide has also been updated to follow these changes.

Gustavo 'Gus' Carreno

  • Hero Member
  • *****
  • Posts: 1119
  • Professional amateur ;-P
Re: An OAuth2 Client for Lazarus
« Reply #6 on: August 25, 2021, 05:21:48 pm »
Hey Tony,

I guess the Build Modes aren't that necessary. I think it's me being a bit too zealous :)

I did, nonetheless, created a PR that will redirect all binaries to a bin folder present at the root of the repository and added it to .gitignore.

Cheers,
Gus
Lazarus 3.99(main) FPC 3.3.1(main) Ubuntu 23.10 64b Dark Theme
Lazarus 3.0.0(stable) FPC 3.2.2(stable) Ubuntu 23.10 64b Dark Theme
http://github.com/gcarreno

 

TinyPortal © 2005-2018