ComponentSpace

Forums



InvalidOperationException: while injecting SAMLConfiguration


InvalidOperationException: while injecting SAMLConfiguration

Author
Message
amrelsayed
amrelsayed
New Member
New Member (9 reputation)New Member (9 reputation)New Member (9 reputation)New Member (9 reputation)New Member (9 reputation)New Member (9 reputation)New Member (9 reputation)New Member (9 reputation)New Member (9 reputation)

Group: Forum Members
Posts: 7, Visits: 12
Hi,

I am using ComponentSpace V2.0.2 for .Net Core and when I try to add SAML module in the startup.cs file in configureServices method as of this way below:


services.Configure<SamlConfigurations>(Configuration.GetSection("SAML"));
services.AddSaml();


it then gives me an exception: InvalidOperationException: Cannot consume scoped service 'ComponentSpace.Saml2.Configuration.SamlConfigurations' from singleton 'ComponentSpace.Saml2.Configuration.Resolver.ISamlConfigurationResolver'.

Any help on this please.

Thanks,
Amr

ComponentSpace
ComponentSpace
ComponentSpace Development
ComponentSpace Development (4.4K reputation)ComponentSpace Development (4.4K reputation)ComponentSpace Development (4.4K reputation)ComponentSpace Development (4.4K reputation)ComponentSpace Development (4.4K reputation)ComponentSpace Development (4.4K reputation)ComponentSpace Development (4.4K reputation)ComponentSpace Development (4.4K reputation)ComponentSpace Development (4.4K reputation)

Group: Administrators
Posts: 3.2K, Visits: 11K
Hi Amr
Please take a look at the startup code in our examples.
The code should be:


services.AddSaml(Configuration.GetSection("SAML"));




Regards
ComponentSpace Development
amrelsayed
amrelsayed
New Member
New Member (9 reputation)New Member (9 reputation)New Member (9 reputation)New Member (9 reputation)New Member (9 reputation)New Member (9 reputation)New Member (9 reputation)New Member (9 reputation)New Member (9 reputation)

Group: Forum Members
Posts: 7, Visits: 12
ComponentSpace - 4/25/2019
Hi Amr
Please take a look at the startup code in our examples.
The code should be:


services.AddSaml(Configuration.GetSection("SAML"));



Hi ,

Thank you for your answer, however your solution works for version 2.3 or above of ComponentSpace and we are currently using V2.0, Any advice.

Thanks,
Amr

ComponentSpace
ComponentSpace
ComponentSpace Development
ComponentSpace Development (4.4K reputation)ComponentSpace Development (4.4K reputation)ComponentSpace Development (4.4K reputation)ComponentSpace Development (4.4K reputation)ComponentSpace Development (4.4K reputation)ComponentSpace Development (4.4K reputation)ComponentSpace Development (4.4K reputation)ComponentSpace Development (4.4K reputation)ComponentSpace Development (4.4K reputation)

Group: Administrators
Posts: 3.2K, Visits: 11K
My apologies. I missed that.
Your code matches the examples startup code shipped with v2.0.2.
This code did work with the various Microsoft package dependencies at the time of its release.
However, it's possible that an updated package dependency is causing this issue through more stringent checking etc.
We reviewed the scope of the various classes a little while back.
ISamlConfigurationResolver was a singleton in v2.0.2 but is now a transient in later releases.
Version 2.0.2 was released in 2017.
Are you able to move up to the latest SAML release?




Regards
ComponentSpace Development
amrelsayed
amrelsayed
New Member
New Member (9 reputation)New Member (9 reputation)New Member (9 reputation)New Member (9 reputation)New Member (9 reputation)New Member (9 reputation)New Member (9 reputation)New Member (9 reputation)New Member (9 reputation)

Group: Forum Members
Posts: 7, Visits: 12
ComponentSpace - 4/25/2019
My apologies. I missed that.
Your code matches the examples startup code shipped with v2.0.2.
This code did work with the various Microsoft package dependencies at the time of its release.
However, it's possible that an updated package dependency is causing this issue through more stringent checking etc.
We reviewed the scope of the various classes a little while back.
ISamlConfigurationResolver was a singleton in v2.0.2 but is now a transient in later releases.
Version 2.0.2 was released in 2017.
Are you able to move up to the latest SAML release?



Hi,

Thank you once again for this answer, unfortunately as per your policy we have to pay for the upgrade, and currently I don't think we will be able to, so my question is what should I do so I can make it works as it used to before, is there any upgrades happened for .Net Core or something, please your help would be appreciated.

Thanks,
Amr



ComponentSpace
ComponentSpace
ComponentSpace Development
ComponentSpace Development (4.4K reputation)ComponentSpace Development (4.4K reputation)ComponentSpace Development (4.4K reputation)ComponentSpace Development (4.4K reputation)ComponentSpace Development (4.4K reputation)ComponentSpace Development (4.4K reputation)ComponentSpace Development (4.4K reputation)ComponentSpace Development (4.4K reputation)ComponentSpace Development (4.4K reputation)

Group: Administrators
Posts: 3.2K, Visits: 11K
Are you targeting .NET Core 2.0 or a later release?
Back in 2017, .NET Core 2.0 would have been used to run these examples.

Regards
ComponentSpace Development
amrelsayed
amrelsayed
New Member
New Member (9 reputation)New Member (9 reputation)New Member (9 reputation)New Member (9 reputation)New Member (9 reputation)New Member (9 reputation)New Member (9 reputation)New Member (9 reputation)New Member (9 reputation)

Group: Forum Members
Posts: 7, Visits: 12
ComponentSpace - 4/25/2019
Are you targeting .NET Core 2.0 or a later release?
Back in 2017, .NET Core 2.0 would have been used to run these examples.

Yes, I am targeting .Net Core 2.0

ComponentSpace
ComponentSpace
ComponentSpace Development
ComponentSpace Development (4.4K reputation)ComponentSpace Development (4.4K reputation)ComponentSpace Development (4.4K reputation)ComponentSpace Development (4.4K reputation)ComponentSpace Development (4.4K reputation)ComponentSpace Development (4.4K reputation)ComponentSpace Development (4.4K reputation)ComponentSpace Development (4.4K reputation)ComponentSpace Development (4.4K reputation)

Group: Administrators
Posts: 3.2K, Visits: 11K
Do the example applications run for you?
Was your application working at some stage and then stopped working?
I'll build and run the examples apps with v2.0.2 to see if I can reproduce the issue.

Regards
ComponentSpace Development
amrelsayed
amrelsayed
New Member
New Member (9 reputation)New Member (9 reputation)New Member (9 reputation)New Member (9 reputation)New Member (9 reputation)New Member (9 reputation)New Member (9 reputation)New Member (9 reputation)New Member (9 reputation)

Group: Forum Members
Posts: 7, Visits: 12
ComponentSpace - 4/25/2019
Do the example applications run for you?
Was your application working at some stage and then stopped working?
I'll build and run the examples apps with v2.0.2 to see if I can reproduce the issue.


ComponentSpace - 4/25/2019
Do the example applications run for you?
Was your application working at some stage and then stopped working?
I'll build and run the examples apps with v2.0.2 to see if I can reproduce the issue.

Hi,

Please let me know if you have been able to reproduce the issue, as we are stuck on it.

Thanks a lot for your help.

Amr

ComponentSpace
ComponentSpace
ComponentSpace Development
ComponentSpace Development (4.4K reputation)ComponentSpace Development (4.4K reputation)ComponentSpace Development (4.4K reputation)ComponentSpace Development (4.4K reputation)ComponentSpace Development (4.4K reputation)ComponentSpace Development (4.4K reputation)ComponentSpace Development (4.4K reputation)ComponentSpace Development (4.4K reputation)ComponentSpace Development (4.4K reputation)

Group: Administrators
Posts: 3.2K, Visits: 11K
I wasn't able to reproduce the issue.
I installed the v2.0.2 product, built and ran the examples without any issues using VS 2017.
I didn't make any changes to the projects and I didn't updates any of the project dependencies.
Below is a screenshot of the installed packages.



Various updates are available by I didn't update any of the packages.



Please see if you can build and run the ExampleIdentityProvider and ExampleServiceProvider projects.

Regards
ComponentSpace Development
GO


Similar Topics


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


Password:


Select a Forum....












Forums, Documentation & Knowledge Base - ComponentSpace


Search