mvanrijnen
Members-
Content Count
471 -
Joined
-
Last visited
-
Days Won
1
Everything posted by mvanrijnen
-
POP, IMAP and SMPT with OAuth2 (Microsoft Office 365 services)
mvanrijnen replied to Milo G's topic in Network, Cloud and Web
We went from sending mail through smtp (office365) to the MS Graph interface. Basically, some rest services authenticated with OAUTH2 (register application in azure director), and sending message with json. (simple messages can go in 1 call, messages with big attachments take a bit more work). So with MSGRaph you can send as user with the user authenticating with OAUTH2, of send it from a registered application with clientid&secret etc. etc. user: sendMail - Microsoft Graph v1.0 | Microsoft Docs -
any body can write this code by delphi?
mvanrijnen replied to mofareh's topic in Network, Cloud and Web
..... or you ask Remy 🙂 -
any body can write this code by delphi?
mvanrijnen replied to mofareh's topic in Network, Cloud and Web
In that case, the code is not that difficult, as a Delphi developer you have to be able to do this for 99,9% on your own. So make your own code in Delphi, see if it works, if it doesn't, then post that Delphi code here for reviewing/tips/improvements. -
any body can write this code by delphi?
mvanrijnen replied to mofareh's topic in Network, Cloud and Web
you gonna need more then that code translated to delphi, Probably there will be some authentication/authorisation) things needed before you can post your data. ah, another WhatsApp api, see here tuturioals enough for other languages: WhatsApp API gateway for sending messages and chatbot - Ultramsg -
Try .ApplyStyleLookup
-
Postgresql in the cloud, possible for Desktop App?
mvanrijnen posted a topic in Network, Cloud and Web
Hi,just curious. Anyone experience with using PostgreSql in the cloud (eg google for example), for use in a Windows Desktop application? (have a small app, and the persons using it would like to use it on multiple locations, so i am looking for an easy way out 🙂.) -
Postgresql in the cloud, possible for Desktop App?
mvanrijnen replied to mvanrijnen's topic in Network, Cloud and Web
yes, i already use only SSL, but i think i go another way. I'm thinking of writing a custom server (using e.g. MARS framework), and then use a service like ngrOK to expose the services. only figure out how to keep it 100% private, put a certificate or something with secrets in it. -
Postgresql in the cloud, possible for Desktop App?
mvanrijnen replied to mvanrijnen's topic in Network, Cloud and Web
I know, but it's just a very small app (semi hobby). Besides that, i wonder if its so not done to go that direction (with which i basicly fully agree), why there are so many providers, exposing databases as a "cloudservice"? Other question, what would be the best way to make rest services available for a smapp app, (low cost), save and secure ? (at work we use radserver and all kinds of dedicated servers, firewalls, proxy's, certificates etc etc, can not do that for this small projetc) Without having to administer webservers, certificates etc. (somekind of appliance i can start in the cloud, upload a dll or cgi/isapi module and publish webservice, private&secure) (developed with Delphi, eg. MARS as rest framework) -
Postgresql in the cloud, possible for Desktop App?
mvanrijnen replied to mvanrijnen's topic in Network, Cloud and Web
I discovered there are some more PostgreSQL cloud providers (dedicated or shared). I'm testing with one now, looks ok right now. (i want to prevent rewriting the app to using rest api's etc, instead of querying the DB directly), -
Sending Email via GMail Using OAuth 2.0 via Indy
mvanrijnen replied to Ugochukwu Mmaduekwe's topic in Indy
got it working, just a reminder for people struggling with the large attachments and getting an invalid Content-Range header error: instead: hdr := 'bytes 0..199/200'; // example value MyRequest.AddParameter('Content-Range', hdr, TRESTRequestParameterKind.pkHTTPHEADER); use: MyRequest.AddParameter('Content-Range', hdr, TRESTRequestParameterKind.pkHTTPHEADER, [TRESTRequestParameterOption.poDoNotEncode]); (took only a few hours struggling 🙂, putting a proxy behind it, and see it in 1 minute )/ -
How can I move a window to the left edge of a monitor?
mvanrijnen replied to dummzeuch's topic in VCL
following, same here, told the users to live with it for now 🙂 a solution would be nice. -
Sending Email via GMail Using OAuth 2.0 via Indy
mvanrijnen replied to Ugochukwu Mmaduekwe's topic in Indy
ah, ok. did not had a change to try it. but we decided to go over to use the MS Graph API for outgoing emails. (as we can configure which email sending mechanism our sending services use, so could also be reverted back to smtp when needed). -
Sending Email via GMail Using OAuth 2.0 via Indy
mvanrijnen replied to Ugochukwu Mmaduekwe's topic in Indy
Yes, so i mixed up some things. I was using OAuth2 as user identification, so with the login username/password and MFA authentication, then i got the token and logged in with that token. As i'm adapting some service applications, we have to use client_secret So i'm using the code from @Geoffrey Smith as starting point. I'v adapted it and i get a access token now, with the client_secret (grantype client_credentials), only thing is that the idSMTP.Authenticate does not authenticate with the returned access token. (Authentication unsuccessfull). some hints would be great ! 🙂 maybe i gonna try the sasl-oauth branch from @Remy Lebeau, but i'm a little scared that i then get all kinds of bumps to get another indy branche working. (but i will try this out). btw, is i use the access token generated by method with user/passw + 2fa, then i can send with smtp, found out why i have no success: on the doc page, where they explain smtp oauth2 with client_credentials; Authenticate an IMAP, POP or SMTP connection using OAuth | Microsoft Docs -
Sending Email via GMail Using OAuth 2.0 via Indy
mvanrijnen replied to Ugochukwu Mmaduekwe's topic in Indy
Ok, i have a question, in this case i adapted our sending servers to use oauth. We are using office365/exchange online. But the clientsecrets generated in the Azure AD (AppRegistrations), what use are they? * I only have to use the application-id, and an account+password to generate the token. This generated token i put in a config for later use, but in the method i use now, the clientsecrets are never used? -
var oldevent : TNotifyEvent; begin oldevent := myComponent.OnExit; try myComponent.OnExit := nil; ..... your code here ... finally myComponent.OnExit := oldevent ; end; end; maybe expand the oldevent scope some more if you want to reassign in another method.
-
Yes, i use this one for a planner app we developed (inhouse use). No problems so far, ofcourse somehtings are sometimes slight different, but those guys know what their doing,
-
To Whom It May Concern: Deprecation of Basic authentication in Exchange Online
mvanrijnen posted a topic in Network, Cloud and Web
I thought some of you might be interested in this: https://docs.microsoft.com/en-us/exchange/clients-and-mobile-in-exchange-online/deprecation-of-basic-authentication-exchange-online -
ShowModal does not show window after a few tries (It does not pop up)
mvanrijnen replied to ChrisChuah's topic in VCL
I tried it with 2 almost empty forms in D11.1, with same method as TS, but the modalform stays appearing on top, after 50 times. Is TS using a specific componentset ? or does the subform do something with z-order ? (i last had some troubles with a specific componentset in D11.1 on Win11, where i had 2 click the closebutton of the "child" form twice to close, but they fixed that) ah, read over the styles part, try that also here now. -
ShowModal does not show window after a few tries (It does not pop up)
mvanrijnen replied to ChrisChuah's topic in VCL
From the manual: " caFree The form is closed and all allocated memory for the form is freed. " @TS, Maybe, maybe, FDetailForm.SetZOrder(True) would help. if i remeber there's also a winapi call to reset/refresh zorder of windows, i'll try to find that. (but big question is still why form goes behind mainform after couple of times) -
ShowModal does not show window after a few tries (It does not pop up)
mvanrijnen replied to ChrisChuah's topic in VCL
See this in the OP: In the Form Close of the TfrmAircraftTypesNew, i will have Action := caFree; -
Not personal, but there is a reason why we use a webbrowser instead of a TV set. I like to read this kind of things instead of watching YT 😉 (just a comment)
-
FireDAC - TFDQuery - How to default calculated fields in the dataset to ReadOnly=False
mvanrijnen replied to JonathanW's topic in Databases
Is not what the TP indicates with glhis post, what you post is not the question. You suggest first let the DB do it's work, retrieve that result, and on client side, overwrite that result with a clientside calculation? -
FireDAC - TFDQuery - How to default calculated fields in the dataset to ReadOnly=False
mvanrijnen replied to JonathanW's topic in Databases
You'd better add calculated fields to the dataset, and use the OnCalcFields event. That way you can locally do then calculations, Use a slight different fieldname for the locally calculated, or same and don't fetch the calculated fields in the query. -
Best to remember position instead of displaynumber (and windowmode (maximized or not)). You also want to check if the position you set your form on still is visible, user could have disconnect a display for instance., so you can make sure your app is visible on startup.
-
Community Edition expiring again, no new keys
mvanrijnen replied to Nigel Thomas's topic in Delphi IDE and APIs
Yes, they have to put in a licensing model like VisualStudio, free to use (free version same as cheapest commercial version), and from a revenue of USD xxxxxxx (fill in a number), then you start paying. (okay, have to figure out internal licenses for internal development) How bigger the community the bigger the paying licenses, but give the people a full unrestricted product.