- An easy to use library that makes connecting with Ontario Health easy for .NET Kestrel/Owin/Katana applications.
About | Usage | Development | Gallery | Acknowledgement | License
This library was created by Clinical Support Systems and Kori Francis, who have experience integrating with APIs of varying complexity. We wanted to simplify the connection in .NET web applications so we could get on with the actual API implementation.
To make integration simple, there's support in this middlewear to adjust the scope and profile depending on the service you're integrating with. As such, we currently support the following:
This will allow you to perform authentication once but retrieve an access_token
that can access multiple services.
- ✔️ Authenticate
- ✔️ Discovery
- ✔️ User Info
- ✔️ Validation (use JSON Web Key Set)
- ✔️ Manual refresh
- ❌ End Session
- ❌ Logout
Here is how to use this library in your project.
Install-Package AspNet.Security.OAuth.OneID
Add the following to your authentication pipeline:
OWIN/Katana (ASP.NET)
app.UseOneIdAuthentication(new OneIdAuthenticationOptions()
{
CertificateThumbprint = ConfigurationManager.AppSettings["EHS:CertificateThumbprint"],
ClientId = ConfigurationManager.AppSettings["EHS:AuthClientId"],
Environment = OneIdAuthenticationEnvironment.PartnerSelfTest
});
Kestrel (ASP.NET Core)
services.AddAuthentication().AddOneId(options =>
{
options.ClientId = Configuration["EHS:AuthClientId"];
options.CertificateThumbprint = Configuration["EHS:CertificateThumbprint"];
options.Environment = OneIdAuthenticationEnvironment.PartnerSelfTest;
});
In the case of multiple service usage, simply specify that in the authentication options:
services.AddAuthentication().AddOneId(OneIdAuthenticationDefaults.AuthenticationScheme, (OneIdAuthenticationOptions options) =>
{
// ...
options.ServiceProfileOptions = OneIdAuthenticationServiceProfiles.OLIS | OneIdAuthenticationServiceProfiles.DHDR;
});
If you want other people to contribute to this project, this is the section, make sure you always add this.
List all the pre-requisites the system needs to develop this project.
- You will need a PKI certificate from Ontario Health (OH)
- You will need login credentials from Ontario Health (OH)
Run this command:
dotnet list package --include-transitive | sls "Microsoft.IdentityModel|System.IdentityModel"
If there are differences in the versions of the output, make sure to update those packages to all the same version. This is how the models and clients are kept in sync.
See this for more info.
Your contributions are always welcome and appreciated. Following are the things you can do to contribute to this project.
-
Report a bug
If you think you have encountered a bug, and I should know about it, feel free to report it and I will take care of it. -
Request a feature
You can also request for a feature. -
Create a pull request
It can't get better then this, your pull request will be appreciated by the community. You can get started by picking up any open issues from here and make a pull request.
If you are new to open-source, make sure to check read more about it here and learn more about creating a pull request here.
I use an agile continuous integration methodology, so the version is frequently updated and development is really fast.
-
develop
is the development branch. -
master
is the production branch. -
No further branches should be created in the main repository.
Steps to create a pull request
- Make a PR to
master
branch. - Comply with the best practices and guidelines e.g. where the PR concerns visual elements it should have an image showing the effect.
- It must pass all continuous integration checks and get positive reviews.
After this, changes will be merged.
- Kori Francis
- David Ball
- Alex McKeever
- Victoria Tolls