first - if this is the wrong place in the forum for this question, please move it to the correct topic!
I'm trying to migrate an old SO Server Tool to SO Online, but I'm not sure, how I can achieve this now with one of the authentication workflows and APIs. Since I'm new to SO, this is very overwhelming for me - I already read a lot of tutorials/forum entries/etc. - but the more I read about it, the more confusion becomes. Not because it's not good documented, more because of the power of the API a developer obtains.
The best option would be to use the same implementation as before.
A short overview about the application:
- Console application written in C# with .NET Framework 4.7.2
- Used the packages
- Authentication with username + password
The task of the tool is to convert contact data entries (and extended information, like telephone number) to a .csv file automatically once a day. We use it to migrate these data to our main telephone system. We created a "Selection" in the SO Web UI to query it. Furthermore, we used the ArchiveAgent with the ArchiveRestrictionInfo to obtain the data from the Selection, like this code example shows:
_mySession = SoSession.Authenticate(_user, _password);
//Initializing an Archive Agent
using (ArchiveAgent newArcAgt = new ArchiveAgent())
//Get the dynamic selection with the ID = 136
ArchiveRestrictionInfo archiveRest = new ArchiveRestrictionInfo;
archiveRest = new ArchiveRestrictionInfo("selectionId", "=", 136);
// Get a page of results for an archive list, explicitly specifying the restrictions, orderby and chosen columns
ArchiveListItem arcLstItm = newArcAgt.GetArchiveListByColumns(
"ContactSelection", _archiveColumns, new ArchiveOrderByInfo,
archiveRest, null, page, int.MaxValue); //MaxValue = Display all content on page 0
if ("[I:136]" == archiveRest.ScalarValue) //Check if the correct Selection have been found
_logger.Info("Selection has been found! 'Alle Personen für Starface'");
foreach (ArchiveListItem archiveRow in arcLstItm)
foreach (ArchiveColumnData archiveCell in archiveRow.ColumnData.Values) //Read all the ID's from the persons
string temporaryPersonId = archiveCell.DisplayValue.Replace("[I:", "").Replace("]", ""); //Split the ID from the brackets [ID]
int personId = Convert.ToInt32(temporaryPersonId);
_logger.Debug("GetIDs; PersonId Added; " + personId);
_logger.Error("Selection couldn't be found -- 'Alle Personen für Starface'");
Now, the authentication needs to be done by another workflow when using SO Online - this is what I need to adapt to get the tool running again.
But how can I achieve this?
- Is it even possible to authenticate my tool without redirecting to a federation gateway since it won't be executed by a human user who can enter credentials? Is the SystemUser workflow the correct way for me? Like: Github SuperOffice.DevNet.Online
- If yes, what is the "ContextIdentifier" and "SystemUserToken"?
I have already registered as developer and also added my application (I'm not sure, if I have correct register it, since I don't know the different use cases for authentication). I got the application ID, the client secret and the apps private key for system user token signing. Furthermore, I also got access to a test tenant.
Can you please give some advices, to get the authentication work? It's "only" the authentication which is missing here. Maybe I'm on the correct way with the System User workflow?
Thanks a lot and best wishes!