Inforit.Security.Authentication 1.1.0
Inforit.Security.Authentication package
Description
This repository contains the code for legacy (NET 4 full framework) OIDC support for APIs
Getting started
- For npm, use
npm install - Use
dotnet build,npm run buildor your IDE to build. - Use
dotnet test,npm run testor use the test explorer from your IDE to test
Using the package
Add Inforit.Security.Authentication package to project.
var authority = "https://sts.pp-transfusion.cloud/realms/inforit";
var audience = "tf2-client-id";
var options = JwtBearerAuthenticationOptionsBuilder.BuildJwtBearerAuthenticationOptions(authority, audience);
// To customize validation
options.TokenValidationParameters.ValidateAudience = false;
app.UseJwtBearerAuthentication(options);
Build and publish
Not setup yet for automated publish
- Run
dotnet buildto build (ornpm run build) - Run
dotnet pack --output outputto create the nuget package (ornpm run pack)
Publish configuration
Run dotnet nuget push -k $MYGET_ACCESS_TOKEN -s $MYGET_PUBLISH_PACKAGE_SOURCE
Configuration of the package feed is done with environment variables:
- Package feed uri:
$MYGET_PUBLISH_PACKAGE_SOURCE - Package feed api key:
$MYGET_ACCESS_TOKEN
Sonarcloud
Not setup yet
For code analysis the created project has to be configured in Sonarcloud and Bitbucket. The build pipeline is pre-configured to support this code analysis. To disable this just comment out the related pipelines (not recommended).
Connecting to Sonarcloud requires the following environment variables to be set:
- Sonarcloud project id:
$SONAR_PROJECT - Sonarcloud project specific token:
$SONAR_TOKEN
No packages depend on Inforit.Security.Authentication.
.NET Framework 4.7.2
- Microsoft.IdentityModel.Protocols.OpenIdConnect (>= 6.30.1)
- Microsoft.Owin.Security.Jwt (>= 4.2.2)
- NLog (>= 5.1.4)