authenticate/connect the MFA enabled SharePoint O365 via program
before to go with Open ID one question: do you need to run your code under delegated permissions (on behalf of some user) or it is Ok to run it under application permissions? In last case regular approach is to register new app in Azure AD (which is behind your SP Online), then for this app add API permissions > Sharepoint (there are several different permissions, check what is needed for your scenario), grant admin consent and then generate client secret. After that you may use clientId/secret to connect to SPO (also MS recommends nowdays to use SSL certificate instead of client secret, but it is bit more complex. You may start with client secret as well)