Skip to main content

Konfiguration Authentication Code Flow (delegated) MS Graph API [ENG]

Konfiguration in Squeeze

DieseThis Konfigurationsoberflächeconfiguration wirdinterface abis derprovided Versionas of version 2.3.0 bereitgestellt.0.

WennIf Sieyou diesewant Authentifizierungsmethodeto nutzenuse möchten,this stellenauthentication Siemethod, sicher,make dasssure derthat Internethe JobInternal job refresh-tokens aktiviertis ist.enabled. DiesThis istis weiterdocumented untenfurther imdown Artikelin dokumentiert.the article.

image-1667829176140.png


WieAs manyou nuncan erkennt,see kann mannow, in derthe Konfigurations-Oberflächeconfiguration unterinterface Protokollunder zweiProtocol Artenyou dercan Anbindungchoose zutwo types of connection to Microsoft(MS) Graph API wählen:API:

image-1667829730505.png

FürFor denthe delegiertendelegated Autorisierungsprozessauthorization wählenprocess wirwe select Microsoft Graph API Delegated.Delegated. ImIn nächstenthe Schrittnext füllenstep wirwe diefill Felderin the Client ID, Client Secret dieSecret, Tenant ID undand diethe restlichenrest Felder.of the fields. 

OrdnerFolder - KonfigurationConfiguration

BeiIn derthe Ordnerkonfigurationfolder müssenconfiguration Sieyou dreineed Ordnerto angebenspecify three folders

image-1674472601295.png

  1. PosteingangInbox
    DieserThis Ordnerfolder wirdis regelmäßigregularly überprüft,checked umto dieimport enthaltenenthe Emailsemails zuit importieren.contains. 
  2. VerarbeitetExported
    InThe diesensuccessfully Ordnerimported werdenemails dieare erfolgreichmoved importierento Emailsthis verschoben.folder.
  3. FehlerError
    InThe diesenemails Ordnerthat werden,could dienot Emailsbe abgelegt, die nicht importiert werden konntenimported (z.B.e.g. fehlendemissing Anlagen)attachments) are moved to this folder.

BeiWhen derdefining Definitionthe derfolders, Ordnerplease achtenmake Siesure bittethat darauf,the dassnames dieof Namenthe derfolders Ordnermust eindeutigbe seinunique, müssen,because dathe diefolders Ordnerare searched in derthe Verzeichnisstrukturdirectory desstructure Postfachsof gesuchtthe werden.mailbox.
If
Ista einconfigured konfigurierterfolder Ordneris nichtnot eindeutigunique, kannthis escan dieslead dazuto führen,a dassdifferent einfolder andererbeing Ordnerused genutztthan wird,the alsdesired der gewünschte.one. 

KonfigurationConfiguration in AAD (Azure Active Directory)

WeitereOther notwendigenecessary Schrittesteps fürfor eina reibungslosensmooth Ablaufprocess sindare diethe Einrichtungsetup einerof Azure-Active-an Azure Active Directory Application
mitwith einema Client Secret. DieThe Globaleglobal Registrierungregistration einesof Mail-Dienstesa dermail service of "Dexpro"  imin Azure-Active-Directory the desAzure Kunden,Active wirdDirectory vorerstof nichtthe angeboten.

Zudemcustomer mussis daraufnot geachtetoffered werdenfor dassthe dietime Applicationbeing.

folgende

In Scopesaddition, besitzt.it must be ensured that the application has the following scopes. 

image-1667831638945.png

Anders alsUnlike in denthe Permission für denfor Client Credential FlowFlow, istany jeglichepermission Permissionhere hieris beschränktlimited aufto denthe autorisierendenauthorizing User.user.

Merke:Note: WennIf aufa einshared Shared-mailbox is to be accessed, the shared mailbox must be entered under Mailbox Postfachand zugegriffen werden soll, muss das Shared-Mailbox Postfach unter Postfach eingetragen werden und diethe Application Permission Mail.Read.Write.Shared mussmust konfiguriertbe werden.configured.

DenkenRemember Siethat daran,the dassshared diemailbox Shared-Mailboxwill auchalso Ihrerbe Email-Aktiviertenadded Sicherheitsgruppeto hinzugefügtyour wird,Email wennEnabled Siesecurity einegroup eingerichtetif haben.you have one set up.


EbenfallsAnother einsignificant maßgebenderdifference Unterschiedto zumthe Client Credential Flow istis hierthe dieuse Verwendungof einera Redirect URI
DieseThis Redirect URI wirdis created in derthe AzureActive-DirectoryAzureActive unterdirectory derunder the Application imin Reiterthe Authentication angelegt:tab:

image-1667834984266.png

SchemaScheme Redirect URI: https://Ihr.vollwertiger.DomainName/api/v2/importers/email/authenticate/end

Merke: Note:Ein A Squeeze Mandantclient benötigtalways immerrequires einean Azure-Active-Azure Active Directory Applicationapplication mitwith jeweilsa einer Redirectredirect URI.
DasThis bedeutetmeans Siethat müssenyou fürmust jedencreate Mandantenan eineapplication Applicationfor anlegen.each client.

AutorisierungsprozessAuthorization Process Authentication Code Flow

hatOnce manyou nunhave seineconfigured Applicationyour imapplication in the AAD konfiguriertand undentered alleall notwendigenthe Datennecessary data in diethe Konfigurationsoberflächeconfiguration getipptinterface, kannyou man can nunsave seineyour Konfiguration abspeichern.configuration. 

image-1667832067117.png

NunNow öffnetanother sichdialog einbox weiteres Dialog Feld :opens:

image-1667832557714.png
DasThe Systemsystem hathas Ihresaved Konfigurationyour gespeichert,configuration, denbut Prozessyou derneed Authentifizierungto müssenstart Siethe jedochprocess separatof überauthentication einenseparately Buttonusing a button in derthe Emailemail Konfigurationconfiguration. starten.For Hierfürthis wählenpurpose Sieplease bitteselect denthe folgendenfollowing Button:button:

image-1667832766364.png

NachAfter einemclicking Klickthis aufbutton, diesenyou Buttonwill werdennow Siebe nunredirected zurto Oberfläche vonthe Microsoft weitergeleitet.interface. DortThere, beginntthe derauthentication Authentifizierungsprozessprocess befolgenbegins. SieFollow dieMicrosoft's Anweisungen von Microsoft:instructions:

GebenEnter Sieyour ihreemail Email-Adresse an.address.

image-1667834432799.png

GebenEnter Sieyour Ihr Passwort ein:password:

image-1667834456501.png

JeDepending nachon Unternehmenthe werdencompany, Sieyou ebenfallsmay aufgefordertalso einebe asked to perform 2-Faktor-Authentifizierungfactor durchzuführen.:authentication:

image-1667834490358.png

SobaldOnce Sieyou Authentifiziertare sind,authenticated, werdenyou diewill Berechtigungenbe abgefragtprompted undfor Siepermissions werdenand aufgefordertasked dieseto Berechtigungenconfirm zuthose bestätigen.permissions. NachAfter Ihreryour Bestätigung leitetconfirmation, Microsoft umgehendwill zurückimmediately zurredirect Squeeze-Oberfläche.you back to the Squeeze interface. 

DieThe Oberflächeinterface wirdwill Ihnennow nunshow anzeigenyou obif Squeeze nunis Autorisiertnow istauthorized oderor obif einan Fehlererror aufgetretenhas ist:occurred:

image-1667834259123.png
NunNow könnenyou Siecan dietest the mail connection by clicking the Mail VerbindungConnection testenTest Indem Sie den Mail Verbindungstest Buttonbutton in derthe Oberfläche bedienen.interface. 

Job-KonfigurationConfiguration

DieThe Verwendunguse diesesof Authentifizierungsverfahrensthis erfordert,authentication dassmethod einrequires seperaterthat Joba aktiviertseparate ist,job welcheris imactivated, Hintergrundwhich diekeeps Zugriffsdatenthe füraccess diedata for the Graph API aktuellup-to-date hält.in the background.

HierfürFor findenthis wirpurpose, we find the new script named refresh-tokens in derthe Administrationadministration unter "Skripte" das neue Skript  mit den Namenunder refresh-tokens"Scripts":

image-1667905655850.png

DiesesYou Skriptcan kannrun manthis zuscript jedemmanually Zeitpunktat manuellany ausführen.time.

SieYou müssenneed fürto diesesset Skriptup einena Jobjob einrichten,for derthis häufigscript genugthat ausgeführtruns wird,frequently umenough einto Ablaufenprevent derthe Zugriffsdatenaccess zudata verhindern.from Imexpiring. StandardBy sinddefault, Refresh-Tokenrefresh vontokens from Microsoft are valid for 1 Tagday, langso gültig,you esshould solltetry alsoto mehrmalsrefresh amthe Tagaccess versuchtdata werdenseveral dietimes Zugriffsdatena zu aktualisieren.day.

WirWe empfehlenrecommend denrunning Jobthe jedejob Stundeevery auszuführen:hour:
Cron-AusdruckCron fürexpression denfor Job:the job: */50 * * * *.

WieHow Jobsto zuconfigure konfigurierenjobs sind,is istdocumented hier dokumentiert:here:

Fragen und Antworten

WasWhat passierthappens wennif derthe Jobjob ausfällt ?fails? 
IstIf derthe Jobjob durchdid unvorhersehbarenot Gründerun nichtdue gelaufento sounforeseen müssenreasons Sieyou sichhave neuto Authentifizierenre-authenticate mitusing demthe Authentifizierung-Buttonauthentication button in derthe Email-Konfigurationemail configuration.
KannCan ichI einfachjust meinechange Postfachmy mailbox in derthe Konfigurationconfiguration ändernand unddo mussI ichhave danachto wasdo tunanything ?after that? 
SobaldAs Siesoon dieas Konfigurationyou ändernchange oderor abspeichern,save weistthe dieconfiguration, Anwendungthe Sieapplication daraufprompts hin,you einto neueninitiate Authentifizierungsprozessa einzuleiten.new authentication process. 
LehnenReject Siethis diesesrequest. AufforderungYou ab.still Habenhave Siethe immernochoption dieto Möglichkeitpress denthe Authentifizierungsbuttonauthentication zu betätigen.button.
KannCan ichI meineuse Azure-Active-my Azure Active Directory Application fürfor mehreremultiple Squeeze Mandanten nutzen ?clients?

Nein,No, dieusing Verwendung einerone Application (AAD) fürfor mehreremultiple Mandantenclients istis nichtnot Möglich,possible solangeas dielong Mandantenas unterthe anderenclients Domänenare erreichbaraccessible sind.under other domains. 
Beispiel:Example:
1 Mandant:client:

test.mandant.client.squeeze.one

 


2 Mandant:
client:

test2.mandant.client.squeeze.one

 

In diesemthis Beispielexample kannwe mancannot keineuse Applicationan verwenden,application, dabecause wirwe procan Applicationonly nuraddress einenone Mandantenclient ansprechenper können.application. EinAuthentication Authentifizierung beiwith Microsoft würdewould ggf.only immerrun nuron aufone einenclient Mandantenat laufen.a time.

 

DuYou hasthave diethe Möglichkeitpossibility mehrereto Postfächeruse mitmultiple dermailboxes selbenwith Application(the same application (AAD), zuthere nutzen,are dortno gibt es keine Begrenzungen.limits.