RS Authentication Server

OpenID Connect discovery document

Nuget packages

Authentication provide 3 nuget packages.

  • RSServices.Authentication.Middleware
  • RSServices.Authentication.Abstractions
  • RSServices.Authentication.Middleware.NServiceBus


This packages provide easy setup of Authentication for .NET Core WebApp

In Startup.cs

public void ConfigureServices(IServiceCollection services) { ... services.AddRSAuthentication(Configuration) //Customize default login providers. Support values from ExternalIdentityProviders and LocalProvider .SetDefaultLoginProviders(ExternalIdentityProviders.NorwegianBankIdMobile, LocalProvider.Orgsys) //Optional to customize loginproviders on Controller level .SetLoginProvidersFor<SupportController>(ExternalIdentityProviders.AzureAd); ... } public void Configure(IApplicationBuilder app) { ... app.UseForwardedHeaders(); //Use RS Authentication app.UseRSAuthentication(); //to use [Authorize] app.UseAuthorization(); ... }

AddRSAuthentication(Configuration) configure authentication with values from appsettings.json.

RSAuthentication use Redis as TicketStore and DataProtection, so redis connectionstring is needed in ConnectionStrings section

appsettings.json format

{ "AppName": "YourApplicationName", "Environment": "Test", //UAT,Prod "Authentication": { "ClientId": "YourClientId", "AuthorityUrl": "" }, "ConnectionStrings": { "Redis": "redisconnectionstring" } }

Available environments

Contact RSServices team before to get your own clientId


This package have IPrincipalAccessor to get information of the authenticated user

IPrincipalAccessor.GetPersonId() to get the current loggedIn person id. This can be used to get the logged in Person from RSServices.Person

IPrincipalAccessor.GetAuditPerson() to get the info on who is the current user and who the person has impersonated into.


Provide IPrincipalAccessor information into NServiceBus messages

BankId test users

Information on ordering new test users can be found here:

All test users have the same OTP (one time password) and password.
OTP: otp
Password: qwer1234

SSN Lastname Firstname

Orgsys test users

Log in to Orgsys test client, and create a new user. Then trigger export to Staging. The new user will be added on next import

Otherwise, ask for a test user