File tree Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Original file line number Diff line number Diff line change @@ -375,4 +375,31 @@ public override string GetRequest()
375
375
}
376
376
}
377
377
}
378
+
379
+ public static class MetaData
380
+ {
381
+ /// <summary>
382
+ /// generates XML string describing service provider metadata based on provided EntiytID and Consumer URL
383
+ /// </summary>
384
+ /// <param name="entityId"></param>
385
+ /// <param name="assertionConsumerServiceUrl"></param>
386
+ /// <returns></returns>
387
+ public static string Generate ( string entityId , string assertionConsumerServiceUrl )
388
+ {
389
+ return $@ "<?xml version=""1.0""?>
390
+ <md:EntityDescriptor xmlns:md=""urn:oasis:names:tc:SAML:2.0:metadata""
391
+ validUntil=""{ DateTime . UtcNow . ToString ( "s" ) } Z""
392
+ entityID=""{ entityId } "">
393
+
394
+ <md:SPSSODescriptor AuthnRequestsSigned=""false"" WantAssertionsSigned=""true"" protocolSupportEnumeration=""urn:oasis:names:tc:SAML:2.0:protocol"">
395
+
396
+ <md:NameIDFormat>urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified</md:NameIDFormat>
397
+
398
+ <md:AssertionConsumerService Binding=""urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST""
399
+ Location=""{ assertionConsumerServiceUrl } ""
400
+ index=""1"" />
401
+ </md:SPSSODescriptor>
402
+ </md:EntityDescriptor>" ;
403
+ }
404
+ }
378
405
}
You can’t perform that action at this time.
0 commit comments