Leaderboard
Popular Content
Showing content with the highest reputation on 11/22/22 in all areas
-
OAuth Authentication Embedded or Standard Browser?
Angus Robertson posted a topic in ICS - Internet Component Suite
Originally it was considered allowable for native applications to display an embedded browser window in the application to capture the Authorization Code during redirect. But that potentially means the application can also capture the login as well so is no longer best practice, see RFC8252, and some apps will block the embedded window. The preferred authorization method is for the native application to launch the standard browser and redirect to localhost where a small web server runs to capture the Authorization Code. When OAuth2 was originally added to ICS, the only embedded browser available in Delphi was TWebBrowser using Internet Explorer, which Microsoft had announced was being removed from Windows and Google was ceasing to support. So ICS initially only supported the standard browser for authentication using a local web server. Since then Delphi 10.4 added the embedded TEdgeBrowser Chromium based browser and despite MSIE disappearing TWebBrowser still seems to work, so ICS now also supports both as Embedded Browsers, to provide a better user experience during authentication, with the window closing automatically and not needing a local web server (that may be blocked by a firewall). Earlier Delphi versions will support TWebBrowser but this no longer works with Google, so applications should still allow the standard browser to be used. Edge Chromium can be installed on Windows 7 and later. The form checks for Edge in the registry and for the WebView2Loader.dll, otherwise uses TWebBrowser. Officially the Microsoft.Web.WebView2 runtime (from GetIt) must be installed for Edge Chromium to work, but in practice copying WebView2Loader.dll into the same directory as the executable seems to work, there are Win32 and Win64 versions of this DLL with the same name, you need the correct version for the build! SVN and the overnight zip have a new ICS beta with the new window, it is currently only supported for Delphi 10.4 and 11, VCL only, later betas will add TWebBrowser for old Delphi versions and FMX. Any feedback on the new window cosmetics and it's operation would be appreciated before this is finally released. All three SSL samples for sending and receiving email have been updated with the new window. Angus -
Function with 2 return values ?
Lars Fosdal replied to Henry Olive's topic in RTL and Delphi Object Pascal
Trouble? 😉 I use a record for returning multiple values. Clarity and type safety is of importance to me. -
Compare two TIntegerDynArray
David Heffernan replied to shineworld's topic in RTL and Delphi Object Pascal
Don't think performance is an issue with TArray<T> and using it makes you code better able to work with other generic code. -
Howto handle Android BluetoothLE permissions that are compatible to API29,30,31 ?
Rollo62 replied to Rollo62's topic in Cross-platform
Yes iOS was more stable and Android needed to catch up, but also in older versions it was stable since quite some time. Remember Windows, also there BT was ( and is ) somewhat alien for a long time. The biggest problem is that all OS permanently make changes in the permission system around the hardware, mainly because of GDPR. This enforces still some sudden, hysteric implementations here and there, although I assumed this should be mature meanwile in the whole society for some time. It looks to me that still there are no "best practices" how to handle GDPR in general, no matter for a sales slip in the bakery, for Cookies, for login to EU database, for medical devices, banking or software apps. I'm looking forward for more creepy implementations to come in the future, its not all Android's or iOS's faults. -
Function with 2 return values ?
Fr0sT.Brutal replied to Henry Olive's topic in RTL and Delphi Object Pascal
With changeable bits. I think it perfectly maps to Generics 😄 -
Function with 2 return values ?
Sherlock replied to Henry Olive's topic in RTL and Delphi Object Pascal
My hammer beats every other tool every time. -
Converting C++ API Post Request into Delphi Code
David Schwartz replied to robhercarlos's topic in General Help
This looks like the same question that Randell Carpenter posted in the Cross Platform section. Have you searched Google for curl examples in Delphi? Here's one: This might be useful: https://github.com/Mercury13/curl4delphi Here's another example: http://thundaxsoftware.blogspot.com/2015/12/sending-rest-api-messages-with-delphi.html -
How to display one of several web pages at one URL
nglthach replied to David Schwartz's topic in Network, Cloud and Web
Hi @David Schwartz You would like to do this on client site (at the browser) or server side? Both are easy to implement (not TMS WebCore). If you would like to see a working demo, like my comment and back in tomorrow, I will show you 🙂 -
Sample for doing same thing with Synapse THTTPSend: procedure TestPost; var H: THTTPSend; S: UTF8String; Res: Boolean; begin H := THTTPSend.Create; try S := '{"recipient":"testing@checkbook.io","name":"Widgets Inc.","amount":5,"description":"Test Payment"}'; H.MimeType := 'application/json'; //synapse has separate propery for content-type header H.Headers.Add('accept: application/json'); H.Headers.Add('Authorization: XXXXX'); H.Document.Write(S[1], Length(S)); Res := H.HTTPMethod('POST', 'https://demo.checkbook.io/v3/check/digital'); if Res then begin SetLength(S, H.Document.Size); if H.Document.Size > 0 then H.Document.Read(S[1], H.Document.Size); ShowMessage(format('%d: %s', [H.ResultCode, S])); end else ShowMessage(H.Sock.LastErrorDesc); finally H.Free; end; end; ends with 400: {"error":"Invalid authorization header"} Because sample XXXXX authorization header is not correct obviously....
-
Job Offer - 5 Delphi Devs for bit Time Professionals
Lars Fosdal replied to Daniele Teti's topic in Job Opportunities / Coder for Hire
Very low seen from Norwegian salary range perspectives as well. -
Job Offer - 5 Delphi Devs for bit Time Professionals
David Schwartz replied to Daniele Teti's topic in Job Opportunities / Coder for Hire
EUR and USD are almost equal right now. I was paid $32k back in 1982. Current salaries are around $100k, and even really cheap Delphi devs are $70k. Full stack web devs are up to $150k. Delphi is a "full-stack" tool, but nobody seems to regard it as such. 🙂 -
...no. FDQuery1.SQL.Text := 'select * from tab where code LIKE :Code'; FDQuery1.ParamByName('code').AsString := '%123%'; FDQuery1.Open; ...the "%" is in the parameter! Other Example: Qry.ParamByName('REN').AsString := '%[_]' + Pair.Key + '[_]' + Pair.Value + '%';
-
by the way... FDQuery1.SQL.add('WHERE (MainDirectory LIKE ''%' + Edit1.Text + '%'') OR INSTR(''' + Edit1.Text + ''', MainDirectory) > 0' ); you know what SQL Injection is? https://en.wikipedia.org/wiki/SQL_injection The german site is better... With delphi examples: https://de.wikipedia.org/wiki/SQL-Injection 🙄 Always use parameters!
-
Function with 2 return values ?
Uwe Raabe replied to Henry Olive's topic in RTL and Delphi Object Pascal
Hey, we also have TPair<Double, Double>. -
Function with 2 return values ?
David Heffernan replied to Henry Olive's topic in RTL and Delphi Object Pascal
Whilst you can, this doesn't feel like a great idea. It's one thing returning a tuple in a language like Python with support for unpacking. But a Delphi dynamic array should be used for arrays, things where each item is a different value of the same thing. That's not the case here. They are two distinct things. Use a record, or two out params.