diff --git a/README.md b/README.md index 996f176..2b89c51 100644 --- a/README.md +++ b/README.md @@ -3,25 +3,35 @@ It is a pack of simple utilities to load and parse ADFS metadata. Parser was tes ## Installing -``` -Install-Package DrWatson.Adfs.Metadata +```bash +Install-Package DrWatson.Adfs.Metadata -pre ``` ## Usage -``` -AdfsMetadataServiceAsync svc = new AdfsMetadataServiceAsync(() => +```csharp +AdfsMetadataService svc = new AdfsMetadataLoader(() => { return new HttpClient().GetStringAsync( "https://fs.example.com/FederationMetadata/2007-06/FederationMetadata.xml" ); }); // Exception can be thrown -await svc.Load(); +var metadata = await svc.Get(); -if(svc.Ready) -{ - X509Certificate2 signingCert = svc.SigningCertificate(); - string identity = svc.Identity; -} +// Subsequent calls will return result from cache +metadata = await svc.Get(); + +// Now we can use metadata as: +string IdP = metadata.Identity; +string stringSigningCert = metadata.SigningCertificateString; + +// Or get certificate with the extension method: +X509Certificate2 signingCert = metadata.GetSigningCertificate(); + +// Start reloading +svc.Invalidate(); + +// Now we have a new metadata +metadata = await svc.Get(); ``` \ No newline at end of file diff --git a/src/DrWatson.Adfs.Metadata/AdfsMetadataServiceAsync.cs b/src/DrWatson.Adfs.Metadata/AdfsMetadataLoader.cs similarity index 100% rename from src/DrWatson.Adfs.Metadata/AdfsMetadataServiceAsync.cs rename to src/DrWatson.Adfs.Metadata/AdfsMetadataLoader.cs diff --git a/src/DrWatson.Adfs.Metadata/DrWatson.Adfs.Metadata.csproj b/src/DrWatson.Adfs.Metadata/DrWatson.Adfs.Metadata.csproj index e843291..a3e6361 100644 --- a/src/DrWatson.Adfs.Metadata/DrWatson.Adfs.Metadata.csproj +++ b/src/DrWatson.Adfs.Metadata/DrWatson.Adfs.Metadata.csproj @@ -3,12 +3,12 @@ netcoreapp1.1 false - 0.1.0 + 0.2.0-alpha1 Sergey Tregub (aka DrWatson) - 0.1.0.0 - 0.1.0.0 + 0.1.1.0 + 0.1.1.0 Simple utilities to parse ADFS 3.0 metadata ADFS 3.0 Metadata Parser False