I’m posting this question on behalf of a colleague who is an experienced user of the Embarcadero (ex Borland) C++ Builder suite. He has seen me display Lock in a Xamarin Forms app and in a .NET WPF desktop program using the IBrowser interface and a WebBrowser control (see this thread). He wants to use Lock in a Windows desktop program the same way I have, but there is no C++ SDK and I can’t figure out how to translate my .NET desktop code into C++ and use his equivalent web browser control.
I’m hoping that because the C++ Builder platform includes a web browser control, it can be used to display Lock, perform authentication and return the tokens and claim data to the parent program. Is this feasible? Or do I need to make HTTP calls to the low-level API? Any technical guidance on how to proceed in this situation would be most welcome.
Although in some platforms it is possible to use some sort of web view/browser control available in the platform to display a web page (Lock Web) for authentication purposes this sort of approach has been receiving less attention mostly because there are other alternatives with better security characteristics.
In conclusion, if the C++ builder supports the notion of a web browser control then that approach could be feasible, but like you also mentioned I’m unaware of any code samples for that scenario. In addition, the general recommended approach for a native application would be to launch the authentication flow in a system wide user-agent and then receive a callback with the authentication response (could be accomplished by using redirect URL’s with custom schemes handled by the native application or in some cases by redirecting to localhost based web server that the application is running). This flow is described at a high-level in: Call Your API Using the Authorization Code Flow with PKCE