Connect to SuperOffice Netserver - Failed to create Identity from tokens

Hello,

i try to develop an webservice in Visual Studio. For this i need to connect Superoffice. First i try it with "Imports SuperOffice.COM.SuperOfficeDB", it works localy with the IISExpress without any problems. If i publish it to our local webserver with IIS7 and local install superoffice, i get the message "login failed"

After that i try it with "SuperOffice.NetServer.Services". i installed that with the nuGet Manager in Visual Studio. Locally it works fine, but not on the webserver.

Imports SuperOffice.CRM.ServicesDim soDb As SuperOffice.SoSessionsoDB = SuperOffice.SoSession.Authenticate("crm7", "crm7myd")The IIS process work as an 32bit process because i need an additional old databasedriver, that works only in 32bit mode.

Here ist my web.config:

<SuperOffice>
<Security>
<Cryptography>
<add key="SymmetricKey" value="XXX" />
</Cryptography>
</Security>
<Factory>
<DynamicLoad>
<!--Required to support RemoteMode only-->
<add key="RequiredProxy" value="SuperOffice.Services.WcfProxy.dll"/>
</DynamicLoad>
</Factory>
<Data>
<Session>
<!-- HttpContext means that session information is stored in the Http context, instead of being recreated all the time -->
<add key="Mode" value="Thread"/>
<add key="ReauthenticateOnDeserialization" value="false"/>
</Session>
<Database>
<add key="DatabaseMajor" value="MSSQL"/>
<add key="DatabaseMinor" value="11"/>
<add key="Server" value="SERVER1\SUPEROFFICE"/>
<add key="Database" value="SuperOffice"/>
<add key="CommandTimeOut" value="300"/>
<add key="TablePrefix" value="crm7"/>
<add key="ConnectionString" value="Server=[@Server];Database=[@Database];User ID=[@User];Password=[@Password]"/>
</Database>
<ImplicitAnonymous>
<add key="Allowed" value="False"/>
<add key="DBUser" value="crm7"/>
<add key="DBPassword" value="crm7myd"/>
<add key="CommonDBConnection" value="True"/>
<add key="SoUser" value=""/>
<add key="SoPassword" value=""/>
</ImplicitAnonymous>
<Explicit>
<add key="ExternalPersonAllowed" value="True"/>
<add key="EmployeeAllowed" value="True"/>
<add key="SystemAllowed" value="True"/>
<add key="DBUser" value="crm7"/>
<add key="DBPassword" value="crm7myd"/>
<add key="CommonDBConnection" value="True"/>
</Explicit>
</Data>
<Documents>
<!-- Location of SO_ARC -->
<add key="ArchivePath" value="c:\so_arc"/>
<!-- Location of template folder.
This folder only needs to be specified when it is other than default. -->
<!--<add key="TemplatePath" value="\\\\qa-build\\StateZeroSoArc\\Template" />-->
<!-- Location of temporary folder for streaming files.
This path must resolve to the same location for farms/culsters. -->
<add key="TemporaryPath" value="c:\\temp"/>
<!-- Impersonate user when accessing the document archive or the temporary folder -->
<add key="ImpersonateUser" value="false"/>
<!-- Name of the user to impersonate with -->
<add key="ArchiveUser" value=""/>
<!-- Password of the user to impersonate with -->
<add key="ArchivePassword" value=""/>
<!-- Domain of the user to impersonate with -->
<add key="ArchiveDomain" value=""/>
<!-- Size of internal buffer in KB -->
<add key="BufferSize" value="1024"/>
</Documents>
<Services>
<!-- Mode can be Local, Remote, Switch -->
<add key="DefaultMode" value="Local"/>
<!-- Default mode for the switch. Can be Local or Remote -->
<add key="SwitchDefault" value="Remote"/>
<!-- Timeout before failover in seconds -->
<add key="SwitchFailover" value="60"/>
<!-- Base URL for remote services -->
<!-- only support 8.0 proxies in this release (Remote Mode) -->
<add key="RemoteBaseURL" value="https://crm.scandtrack.com:8443/superoffice/remote/services80/"/>
</Services>
</SuperOffice>

Has anybody an idea, where is the problem?

best regards

Mike

RE: Connect to SuperOffice Netserver - Failed to create Identity from tokens

Hi Mike,

It looks like you are not sure which API to use, so let me just lead with "do not use the COM API in IIS" - use NetServer Services. Now it looks like you are on the right track.  

The only possible reasons for the error "Failed to create identity from tokens" is using wrong credentials or cannot connect to the database - due to configuration errors.

Does the exception have an inner exception? It might provide more details. 

Is crm7 just a database user, and/or also a system user? 

I also see that you have a very specific RemoteBaseURL defined, and the DefaultMode is set to Local. If your web server is in a DMZ, and doesn't have direct access to the database, then you need to set DefaultMode to Remote, and have the web servcice endpoints available at the RemoteBaseURL.

Any more details about your environment and circustances?

Hope this helps.

 

 

Av: Tony Yates 10. sep 2019

RE: Connect to SuperOffice Netserver - Failed to create Identity from tokens

Hi Tony,

thanks a lot for your short answer. I think yesterday it was a black day. I try it  the whole day and nothing works. Today i put it into this forum, you answer and now it works...

crm7 ist the default user, now i try it with another user and it works.

If we want later switisch to SO.Online is it possible to use this interface?

best regards

Mike

 

Av: Mike Behrendt 10. sep 2019

RE: Connect to SuperOffice Netserver - Failed to create Identity from tokens

Hi Mike,

Glad it's working!

Yes, as long as you stick to using datatypes in SuperOffice.CRM.Services namespace, you will be able to use the solution in SuperOffice Online. 

Alternatively, you can use RESTful web services as well. The benefit of this is eliminating any dependency on SuperOffice proxy assemblies, etc. For onsite installations, you can authenticate using username/password or SOTicket, and in online you must authenticate using openid connect. Everything else, API requests, stays the same.  There is a pretty explanation of this in this article.

Best regards. 

Av: Tony Yates 10. sep 2019

RE: Connect to SuperOffice Netserver - Failed to create Identity from tokens

Hi Tony,

thanks a lot for you help. Now it works and i can programming a loittle bit :)

 

best regards

Mike

Av: Mike Behrendt 12. sep 2019