ComponentSpace

Forums



SetConfigurationIDAsync() method does not set the SamlConfiguration ID.


SetConfigurationIDAsync() method does not set the SamlConfiguration...

Author
Message
Kasun Kodagoda
Kasun Kodagoda
Junior Member
Junior Member (60 reputation)Junior Member (60 reputation)Junior Member (60 reputation)Junior Member (60 reputation)Junior Member (60 reputation)Junior Member (60 reputation)Junior Member (60 reputation)Junior Member (60 reputation)Junior Member (60 reputation)

Group: Forum Members
Posts: 19, Visits: 84
I am using ComponentSpace SAML2 SSO Nuget package for ASP.net core in my ASP.net core web application where i need to have multiple SAML configurations to support different clients with different SAML configurations. I am loading the SAML Configurations from a database table and I am populating the samlConfigurations.Configurations property with the list of SamlConfigurations. For each SAMLConfiguration, i am setting the ID from the database table as the ID of the SAML Configuration so that i can set which SAML Configuration to use for each user that is trying to login.
I have SingleSignOn() method in my AccountController that would initiate the Sso. just before initiating the SSO i am setting the Saml Configuratin Id using the SetConfigurationIDAsync() method. The code looks like this.
 
public async Task<IActionResult> SingleSignOn(Operator oper)
{
    int samlIdpConfigId;
    if (oper.SamlIdpConfigId != null)
    {
      samlIdpConfigId = (int) oper.SamlIdpConfigId;
    }
    else
    {
      samlIdpConfigId = oper.MasterEngagement.SamlIdpConfigId ?? -1;
    }
    if (samlIdpConfigId < 0)
    {
      throw new SecurityException("Invalid SamlIdpConfigId found");
    }
    await _samlServiceProvider.SetConfigurationIDAsync(samlIdpConfigId.ToString());
    var partnetName = _configuration.GetValue<string>(Constants.AppSetting.PartnerName);
    await _samlServiceProvider.InitiateSsoAsync(partnetName);
    return new EmptyResult();
}

The problem is the Configuration ID does not seem to be set properly. In the ASP.net core logs that are generated i see the following lines form the ComponentSpace library.

fail: ComponentSpace.Saml2.SamlServiceProvider[100]
  Initiation of SSO to the partner identity provider http://MockIdentityProvider has failed.
ComponentSpace.Saml2.Exceptions.SamlConfigurationException: Multiple SAML configurations exist but a configuration ID hasn't been specified.
 at ComponentSpace.Saml2.Configuration.SamlConfigurations.GetConfiguration(String configurationID)
 at ComponentSpace.Saml2.SamlProvider.GetSamlConfiguration()
 at ComponentSpace.Saml2.SamlServiceProvider.<InitiateSsoAsync>d__5.MoveNext()
fail: ComponentSpace.Saml2.SamlServiceProvider[100]
  Initiation of SSO to the partner identity provider http://MockIdentityProvider has failed.
ComponentSpace.Saml2.Exceptions.SamlConfigurationException: Multiple SAML configurations exist but a configuration ID hasn't been specified.
 at ComponentSpace.Saml2.Configuration.SamlConfigurations.GetConfiguration(String configurationID)
 at ComponentSpace.Saml2.SamlProvider.GetSamlConfiguration()
 at ComponentSpace.Saml2.SamlServiceProvider.<InitiateSsoAsync>d__5.MoveNext()



I can not find any examples or material on how to fix this or how to do this properly if i am doing something wrong. Some help would be much appreciated
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 for this. I can confirm this is a bug in the 1.0.0 release which was rectified in 1.0.1. This is available either from our web site or NuGet.
Let us know if there's still an issue. 

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