Messaging: OAuth Sending
Jobs: Sichtbeleg Anpassungen, Seitenwechsel, Freiräume und Taxpos
This commit is contained in:
@@ -31,7 +31,10 @@ Namespace Mail
|
||||
Public Function Connect(pServer As String, pPort As Integer, pUser As String, pPassword As String, pAuthType As String, pOptions As MailSession.MailSessionOptions) As MailSession.SessionInfo
|
||||
Return MailSession.ConnectToServerWithBasicAuth(pServer, pPort, pUser, pPassword, pAuthType, pOptions)
|
||||
End Function
|
||||
|
||||
Public Function ConnectToO365(pUser As String, pClientId As String, pTenantId As String, pClientSecret As String) As MailSession.SessionInfo
|
||||
Dim oOptions = New MailSession.MailSessionOptions With {.EnableTls1_2 = True}
|
||||
Return MailSession.ConnectToServerWithO365OAuth(pUser, pClientId, pTenantId, pClientSecret, oOptions)
|
||||
End Function
|
||||
Public Function Disconnect() As Boolean
|
||||
Return MailSession.DisconnectFromServer()
|
||||
End Function
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
Imports System.IdentityModel.Tokens
|
||||
Imports System.Net.Security
|
||||
Imports System.Net.Security
|
||||
Imports DigitalData.Modules.Base
|
||||
Imports DigitalData.Modules.Logging
|
||||
Imports Limilabs.Client
|
||||
@@ -91,11 +90,11 @@ Namespace Mail
|
||||
|
||||
Public Function ConnectToServerWithO365OAuth(pUser As String, pClientId As String, pTenantId As String, pClientSecret As String, pOptions As MailSessionOptions) As SessionInfo
|
||||
' Choose server/port based on the client type
|
||||
Dim server As String = If(TypeOf Client Is Smtp, "smtp.office365.com", OAuth2.O365_SERVER)
|
||||
Dim oServer As String = If(TypeOf Client Is Smtp, "smtp-mail.outlook.com", OAuth2.O365_SERVER_IMAP)
|
||||
Dim port As Integer = If(TypeOf Client Is Imap, 993, If(TypeOf Client Is Smtp, 587, 993))
|
||||
|
||||
Dim oSession = New SessionInfo With {
|
||||
.Server = server,
|
||||
.Server = oServer,
|
||||
.Port = port,
|
||||
.ClientId = pClientId,
|
||||
.ClientSecret = pClientSecret,
|
||||
|
||||
@@ -10,7 +10,8 @@ Namespace Mail
|
||||
Private ReadOnly _clientId As String
|
||||
Private ReadOnly _clientSecret As String
|
||||
|
||||
Public Const O365_SERVER As String = "outlook.office365.com"
|
||||
Public Const O365_SERVER_IMAP As String = "outlook.office365.com"
|
||||
Public Const O365_SERVER_SMTP As String = "smtp-mail.outlook.com"
|
||||
Public Const O365_SCOPE As String = "https://outlook.office365.com/.default"
|
||||
Public Const O365_AUTHORITY_PREFIX As String = "https://login.microsoftonline.com/"
|
||||
|
||||
|
||||
@@ -31,5 +31,5 @@ Imports System.Runtime.InteropServices
|
||||
' übernehmen, indem Sie "*" eingeben:
|
||||
' <Assembly: AssemblyVersion("1.0.*")>
|
||||
|
||||
<Assembly: AssemblyVersion("2.1.0.0")>
|
||||
<Assembly: AssemblyFileVersion("2.1.0.0")>
|
||||
<Assembly: AssemblyVersion("2.2.0.0")>
|
||||
<Assembly: AssemblyFileVersion("2.2.0.0")>
|
||||
|
||||
Reference in New Issue
Block a user