ComponentSpace

Forums



XmlSecurity Unable to Connect


XmlSecurity Unable to Connect

Author
Message
jstudzinski
jstudzinski
New Member
New Member (11 reputation)New Member (11 reputation)New Member (11 reputation)New Member (11 reputation)New Member (11 reputation)New Member (11 reputation)New Member (11 reputation)New Member (11 reputation)New Member (11 reputation)

Group: Forum Members
Posts: 5, Visits: 94
I've got everything set up according to the documentation XmlSecurity/api/status returns what it should, however, I am getting this issue:

WinHttpException: A connection with the server could not be establishedSystem.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
HttpRequestException: An error occurred while sending the request.System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
AggregateException: One or more errors occurred. (An error occurred while sending the request.)
System.Threading.Tasks.Task.ThrowIfExceptional(bool includeTaskCanceledExceptions)
SamlSignatureException: An error occurred contacting the XML Security service.ComponentSpace.Saml2.XmlSecurity.XmlSignature.Generate(XElement unsignedElement, AsymmetricAlgorithm signingKey, string digestAlgorithm, string signatureAlgorithm, X509Certificate2 x509Certificate)
SamlSignatureException: Failed to generate XML signature.ComponentSpace.Saml2.SamlProvider.GenerateXmlSignature(XElement unsignedElement, AsymmetricAlgorithm signingKey, string digestAlgorithm, string signatureAlgorithm, X509Certificate2 x509Certificate)

Any thoughts?
ComponentSpace
ComponentSpace
ComponentSpace Development
ComponentSpace Development (3.2K reputation)ComponentSpace Development (3.2K reputation)ComponentSpace Development (3.2K reputation)ComponentSpace Development (3.2K reputation)ComponentSpace Development (3.2K reputation)ComponentSpace Development (3.2K reputation)ComponentSpace Development (3.2K reputation)ComponentSpace Development (3.2K reputation)ComponentSpace Development (3.2K reputation)

Group: Administrators
Posts: 2.2K, Visits: 5.9K
By default we assume the XmlSecurity service to be installed at:
https://localhost/XmlSecurity
If this isn't the case, please ensure your application's appsettings.json specify the correct URL.
For example:
"XmlSecurityUrl": "http://localhost/XmlSecurity"
Our example projects include this setting as we're using http rather than https for testing and demonstration.

Regards
ComponentSpace Development
twheeler
twheeler
New Member
New Member (5 reputation)New Member (5 reputation)New Member (5 reputation)New Member (5 reputation)New Member (5 reputation)New Member (5 reputation)New Member (5 reputation)New Member (5 reputation)New Member (5 reputation)

Group: Forum Members
Posts: 4, Visits: 14
I created an azure web app to host the XmlSecurity api project.  I successfully get back "XmlSecurity, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" when calling http://mydomain.com/api/status, but when I call http://mydomain.com/XmlStatus I get a 404 not found.  Any thoughts why it's not able to find XmlSecurity?
ComponentSpace
ComponentSpace
ComponentSpace Development
ComponentSpace Development (3.2K reputation)ComponentSpace Development (3.2K reputation)ComponentSpace Development (3.2K reputation)ComponentSpace Development (3.2K reputation)ComponentSpace Development (3.2K reputation)ComponentSpace Development (3.2K reputation)ComponentSpace Development (3.2K reputation)ComponentSpace Development (3.2K reputation)ComponentSpace Development (3.2K reputation)

Group: Administrators
Posts: 2.2K, Visits: 5.9K
http://mydomain.com/XmlStatus isn't an endpoint in the application so the 404 is to be expected.
http://mydomain.com/api/status is returning successfully so the application is installed correctly.
Ensure your appsettings.json include:
"XmlSecurityUrl": "http://mydomain.com"



Regards
ComponentSpace Development
twheeler
twheeler
New Member
New Member (5 reputation)New Member (5 reputation)New Member (5 reputation)New Member (5 reputation)New Member (5 reputation)New Member (5 reputation)New Member (5 reputation)New Member (5 reputation)New Member (5 reputation)

Group: Forum Members
Posts: 4, Visits: 14
ComponentSpace - 8/4/2017
http://mydomain.com/XmlStatus isn't an endpoint in the application so the 404 is to be expected.
http://mydomain.com/api/status is returning successfully so the application is installed correctly.
Ensure your appsettings.json include:
"XmlSecurityUrl": "http://mydomain.com"


This is what I have in my appsettings.json
"XmlSecurityUrl": "http://XmlSecurity.azurewebsites.net/XmlSecurity"

I'm seeing this error (below) in the log file coming from my azure.  I think it might have something to do with version of Microsoft.CodeDom.Providers.DotNetCompilerPlatform version.  Anyway you could send the XmlSecurity solution to me so I can update the nuget packages?

Could not load file or assembly 'Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=1.0.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040) at System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMarkHandle stackMark, IntPtr pPrivHostBinder, Boolean loadTypeFromPartialName, ObjectHandleOnStack type) at System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean loadTypeFromPartialName) at System.RuntimeType.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark) at System.Type.GetType(String typeName) at System.CodeDom.Compiler.CompilerInfo.get_IsCodeDomProviderTypeValid() at System.Web.Compilation.CompilationUtil.GetRecompilationHash(CompilationSection ps) at System.Web.Configuration.CompilationSection.get_RecompilationHash() at System.Web.Compilation.BuildManager.CheckTopLevelFilesUpToDateInternal(Int64 cachedHash) at System.Web.Compilation.BuildManager.CheckTopLevelFilesUpToDate(Int64 cachedHash) at System.Web.Compilation.BuildManager.ExecutePreAppStart() at System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters, PolicyLevel policyLevel, Exception appDomainCreationException) 
ComponentSpace
ComponentSpace
ComponentSpace Development
ComponentSpace Development (3.2K reputation)ComponentSpace Development (3.2K reputation)ComponentSpace Development (3.2K reputation)ComponentSpace Development (3.2K reputation)ComponentSpace Development (3.2K reputation)ComponentSpace Development (3.2K reputation)ComponentSpace Development (3.2K reputation)ComponentSpace Development (3.2K reputation)ComponentSpace Development (3.2K reputation)

Group: Administrators
Posts: 2.2K, Visits: 5.9K
This shouldn't be necessary. The XmlSecurity application includes all the necessary and correct versions of DLLs in its bin folder.
I created an Azure ASP.NET web app and was able to successfully call this from the example apps.
The URL is http://csxmlsecurity.azurewebsites.net/api/Status
The appsettings.json is:
"XmlSecurityUrl": "http://csxmlsecurity.azurewebsites.net"
I'll keep this up for a few days.
I suggest connecting to this URL to confirm it works for you.
Let me know if you're still having issues with the deployment.



Regards
ComponentSpace Development
twheeler
twheeler
New Member
New Member (5 reputation)New Member (5 reputation)New Member (5 reputation)New Member (5 reputation)New Member (5 reputation)New Member (5 reputation)New Member (5 reputation)New Member (5 reputation)New Member (5 reputation)

Group: Forum Members
Posts: 4, Visits: 14
ComponentSpace - 8/6/2017
This shouldn't be necessary. The XmlSecurity application includes all the necessary and correct versions of DLLs in its bin folder.
I created an Azure ASP.NET web app and was able to successfully call this from the example apps.
The URL is http://csxmlsecurity.azurewebsites.net/api/Status
The appsettings.json is:
"XmlSecurityUrl": "http://csxmlsecurity.azurewebsites.net"
I'll keep this up for a few days.
I suggest connecting to this URL to confirm it works for you.
Let me know if you're still having issues with the deployment.


It works now.  The problem was that I had this in my appsettings.json file "XmlSecurityUrl": "http://XmlSecurity.azurewebsites.net/XmlSecurity" rather than "XmlSecurityUrl": "http://XmlSecurity.azurewebsites.net".  After I removed the /XmlSecurity from the Url it worked.  This was left over from following the "Service Provider Example Configuration" found in the  "ComponentSpace SAML v2.0 Configuation Guid.pdf"

I'm grateful for your help in getting this resolved.

Thank you!
ComponentSpace
ComponentSpace
ComponentSpace Development
ComponentSpace Development (3.2K reputation)ComponentSpace Development (3.2K reputation)ComponentSpace Development (3.2K reputation)ComponentSpace Development (3.2K reputation)ComponentSpace Development (3.2K reputation)ComponentSpace Development (3.2K reputation)ComponentSpace Development (3.2K reputation)ComponentSpace Development (3.2K reputation)ComponentSpace Development (3.2K reputation)

Group: Administrators
Posts: 2.2K, Visits: 5.9K
You're welcome. I'm glad it's working for you.

Regards
ComponentSpace Development
GO


Similar Topics


Execution: 0.000. 4 queries. Compression Enabled.
Login
Existing Account
Email Address:


Password:


Social Logins

Select a Forum....









Forums, Documentation & Knowledge Base - ComponentSpace


Search