Healthcare Bluebook is an open-source .NET Core library designed to simplify the integration process with Healthcare Bluebook's Single Sign-On (SSO) system using SAML 2.0.
$ dotnet add package AppStream.HealthcareBluebookAppStream.HealthcareBluebook is an open-source .NET Core library designed to simplify the integration process with Healthcare Bluebook's Single Sign-On (SSO) system using SAML 2.0. The library provides an easy-to-use interface to seamlessly integrate your web application with Healthcare Bluebook's SSO.
This library relies heavily on the excellent work done by the ITfoxtec.Identity.Saml2.MvcCore project. We extend our sincere appreciation to the contributors and maintainers of this library for providing a solid foundation for SAML 2.0 integration in ASP.NET Core applications.
Follow these simple steps to integrate AppStream.HealthcareBluebook into your web application.
Install the AppStream.HealthcareBluebook NuGet package in your .NET Core web application using the following command:
dotnet add package AppStream.HealthcareBluebook
In your web app's startup code, add the following lines based on your certificate storage preference:
If your signing certificate is on your machine:
builder.Services
.AddHealthcareBluebook()
.WithCertFileCertificateProvider();
If your signing certificate is in Azure Key Vault:
builder.Services
.AddHealthcareBluebook()
.WithAzureKeyVaultCertificateProvider();
You can also create and use your own implementation of ISigningCertificateProvider:
builder.Services
.AddHealthcareBluebook()
.WithCertificateProvider<YourSigningCertificateProvider>();
Configure your app settings in your appsettings.json or equivalent configuration file:
{
"HcbbSaml": {
"Audience": ">> HCBB audience <<",
"ClientIdAttributeName": "clientid",
"ClientIdAttributeValue": ">> your client id <<",
"Issuer": ">> your saml 'issuer' value <<",
"MemberIdAttributeName": "memberid",
"SignatureAlgorithm": "http://www.w3.org/2001/04/xmldsig-more#rsa-sha256",
"SingleSignOnDestination": "url to HCBB SSO"
},
"AzureKeyVault": { // needed only when using AzureKeyVaultSigningCertificateProvider
"CertificateName": ">> name of the cert in the key vault <<",
"KeyVaultUrl": ">> url to your key vault <<"
},
"CertFile": { // needed only when using CertFileSigningCertificateProvider
"FileName": "cert file name",
"Password": "cert passwrd"
}
}
Inject IHcbbSamlResponseGenerator into your controller and return the SAML response to the browser:
public class HomeController : Controller
{
private readonly IHcbbSamlResponseGenerator _hcbbSamlResponseGenerator;
public HomeController(IHcbbSamlResponseGenerator hcbbSamlResponseGenerator)
{
_hcbbSamlResponseGenerator = hcbbSamlResponseGenerator;
}
public IActionResult GoToHcbb()
{
return _hcbbSamlResponseGenerator
.GenerateHcbbSamlResponse("insert member id here");
}
}
Feel free to contribute to this library! Please do open issues and submit your pull requests so this library can become a robust integartion tool 🚀