I’m configuring a SAML implementation and would like to add Scoping to the AuthnRequest using the high-level API and configuration. So far, I’ve mainly seen examples using the low-level API, but I understand that ComponentSpace moderators recommend using the high-level API whenever possible.
For my project, I need to add the following Scoping section to the AuthnRequest:
I’ve already set up most of my configuration file, but I can’t find any information on how to set Scoping directly via configuration. My question is whether this is possible within the high-level API, and if so, what is the recommended approach or configuration setting?
Any help or example configurations would be greatly appreciated!
Scoping via configuration isn’t supported. Instead, it can be specified in the ISsoOptions parameter to the _samlServiceProvider.InitiateSsoAsync call.
For example:
var ssoOptions = new SsoOptions()
{
TrustedIdentityProviders = new List<ITrustedIdentityProvider>()
{
new SsoOptions.TrustedIdentityProvider()
{
ProviderID = "urn:example:EB:00000000000000000000:entities:0000"
}
}
};
// To login automatically at the service provider,
// initiate single sign-on to the identity provider (SP-initiated SSO).
// The return URL is remembered as SAML relay state.
await _samlServiceProvider.InitiateSsoAsync(partnerName, returnUrl, ssoOptions);