ComponentSpace

Forums



Using IConfigResolver to generate Metadata


Using IConfigResolver to generate Metadata

Author
Message
John Mitchell
John Mitchell
New Member
New Member (8 reputation)New Member (8 reputation)New Member (8 reputation)New Member (8 reputation)New Member (8 reputation)New Member (8 reputation)New Member (8 reputation)New Member (8 reputation)New Member (8 reputation)

Group: Forum Members
Posts: 6, Visits: 13
Currently I'm building metadata (to give to idps) manually using MetadataExporter and filling each field individually (including certs). 

Is there any way to have MetadataExporter use the IConfigResolver class? I'd much rather use a DRY principal and not having to duplicate a bunch of config twice. 
ComponentSpace
ComponentSpace
ComponentSpace Development
ComponentSpace Development (3.9K reputation)ComponentSpace Development (3.9K reputation)ComponentSpace Development (3.9K reputation)ComponentSpace Development (3.9K reputation)ComponentSpace Development (3.9K reputation)ComponentSpace Development (3.9K reputation)ComponentSpace Development (3.9K reputation)ComponentSpace Development (3.9K reputation)ComponentSpace Development (3.9K reputation)

Group: Administrators
Posts: 2.8K, Visits: 8.8K
Are you using the ComponentSpace.Saml2.Metadata.Export.IConfigurationToMetadata interface?
The default implementation of this interface retrieves SAML configuration through the ISamlConfigurationResolver interface.
The ExportMetadata project demonstrates the use of IConfigurationToMetadata.

Regards
ComponentSpace Development
John Mitchell
John Mitchell
New Member
New Member (8 reputation)New Member (8 reputation)New Member (8 reputation)New Member (8 reputation)New Member (8 reputation)New Member (8 reputation)New Member (8 reputation)New Member (8 reputation)New Member (8 reputation)

Group: Forum Members
Posts: 6, Visits: 13
ComponentSpace - 11/20/2019
Are you using the ComponentSpace.Saml2.Metadata.Export.IConfigurationToMetadata interface?
The default implementation of this interface retrieves SAML configuration through the ISamlConfigurationResolver interface.
The ExportMetadata project demonstrates the use of IConfigurationToMetadata.

Thanks for your response. 

In My Startup.cs I have 

services.AddSaml();
services.AddScoped<ISamlConfigurationResolver, MySaml2ConfigResolver>();


(In the MySaml2ConfigResolver I have both GetLocalServiceProviderConfigurationAsync and GetPartnerIdentityProviderConfigurationAsync)

In my metadata controller I then pull in the IConfigurationToMetadata via DI (and set to _metadataConfig) 

Unfortunately when I call 

var exportedMetadata = await _metadataConfig.ExportAsync(clientId.ToString());


I get... 

ComponentSpace.Saml2.Exceptions.SamlException: A local identity or service provider name is required for the SAML entity ID.


However the GetLocalServiceProviderConfigurationAsync is never called. 

ComponentSpace
ComponentSpace
ComponentSpace Development
ComponentSpace Development (3.9K reputation)ComponentSpace Development (3.9K reputation)ComponentSpace Development (3.9K reputation)ComponentSpace Development (3.9K reputation)ComponentSpace Development (3.9K reputation)ComponentSpace Development (3.9K reputation)ComponentSpace Development (3.9K reputation)ComponentSpace Development (3.9K reputation)ComponentSpace Development (3.9K reputation)

Group: Administrators
Posts: 2.8K, Visits: 8.8K
Is ISamlConfigurationResolver.IsLocalServiceProviderAsync being called?
This method is called prior to calling ISamlConfigurationResolver.GetLocalServiceProviderConfigurationAsync.
IsLocalServiceProviderAsync must return true for us to call GetLocalServiceProviderConfigurationAsync.


Regards
ComponentSpace Development
John Mitchell
John Mitchell
New Member
New Member (8 reputation)New Member (8 reputation)New Member (8 reputation)New Member (8 reputation)New Member (8 reputation)New Member (8 reputation)New Member (8 reputation)New Member (8 reputation)New Member (8 reputation)

Group: Forum Members
Posts: 6, Visits: 13
ComponentSpace - 11/20/2019
Is ISamlConfigurationResolver.IsLocalServiceProviderAsync being called?
This method is called prior to calling ISamlConfigurationResolver.GetLocalServiceProviderConfigurationAsync.
IsLocalServiceProviderAsync must return true for us to call GetLocalServiceProviderConfigurationAsync.

That was it! 

Thanks :) 
ComponentSpace
ComponentSpace
ComponentSpace Development
ComponentSpace Development (3.9K reputation)ComponentSpace Development (3.9K reputation)ComponentSpace Development (3.9K reputation)ComponentSpace Development (3.9K reputation)ComponentSpace Development (3.9K reputation)ComponentSpace Development (3.9K reputation)ComponentSpace Development (3.9K reputation)ComponentSpace Development (3.9K reputation)ComponentSpace Development (3.9K reputation)

Group: Administrators
Posts: 2.8K, Visits: 8.8K
You're welcome.

Regards
ComponentSpace Development
GO


Similar Topics


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


Password:


Social Logins

Select a Forum....









Forums, Documentation & Knowledge Base - ComponentSpace


Search