-
Notifications
You must be signed in to change notification settings - Fork 25
Open
Description
One often occuring issue we see when installing OIOSAML based applications, is that the ID of an added IDPEndpoint is mispelled - leading to a situation where it cannot find the default IDPEndpoint. The endpoint is created, since it is added manually in the config file, but the metadata file is not found - resulting in an internal NULL pointer reference, which in turn leaves the person installing it without any clue about what is wrong.
Please make a very visible error message for this kind of situation, explaining what is wrong.
We have solved it by adding this check in SAML20FederationConfig:
internal void Initialize()
if (MetadataLocation == null)
return;
if (!Directory.Exists(MetadataLocation))
throw new DirectoryNotFoundException(string.Format(Resources.MetadataLocationNotFound, MetadataLocation));
string[] files = Directory.GetFiles(MetadataLocation, "*.config");
foreach (string file in files)
{
HandleCreateIdp(file);
}
// CHECK METADATA FILE
foreach (var idp in IDPEndPoints)
{
if (idp.metadata == null)
throw new InvalidDataException($"The IDPEndpoint refering to id \"{idp.Id}\" does not have a corresponding metadata file.");
}
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels