Skip to content

Commit

Permalink
- Package metadata
Browse files Browse the repository at this point in the history
- Readme updated
  • Loading branch information
drwatson1 committed Jun 7, 2017
1 parent ba344c1 commit 82f7c91
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 13 deletions.
30 changes: 20 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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();
```
6 changes: 3 additions & 3 deletions src/DrWatson.Adfs.Metadata/DrWatson.Adfs.Metadata.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
<PropertyGroup>
<TargetFramework>netcoreapp1.1</TargetFramework>
<BuildForLiveUnitTesting>false</BuildForLiveUnitTesting>
<Version>0.1.0</Version>
<Version>0.2.0-alpha1</Version>
<Authors>Sergey Tregub (aka DrWatson)</Authors>
<Company />
<NeutralLanguage />
<AssemblyVersion>0.1.0.0</AssemblyVersion>
<FileVersion>0.1.0.0</FileVersion>
<AssemblyVersion>0.1.1.0</AssemblyVersion>
<FileVersion>0.1.1.0</FileVersion>
<Description>Simple utilities to parse ADFS 3.0 metadata</Description>
<Product>ADFS 3.0 Metadata Parser</Product>
<GeneratePackageOnBuild>False</GeneratePackageOnBuild>
Expand Down

0 comments on commit 82f7c91

Please sign in to comment.