SKP
SKP

Reputation: 161

How can we implement Role based access control in okta for .net core web application

I am able to implement the Authentication using the okta in .net core 2.0 application by using the okta.AspNetCore package . but I am not able to figure out, how to approach for role based authentication here. Ref link:https://developer.okta.com/docs/guides/sign-into-web-app/aspnet/before-you-begin/

Upvotes: 1

Views: 2233

Answers (1)

Max Morrow
Max Morrow

Reputation: 1336

At a high-level, you need to do two things:

  1. Create a claims transformer that maps your Okta groups to roles so ASP.NET recognizes your Okta groups as roles.
  2. Add [Authorize(Roles = "Your Role")] decorators to your endpoints

Okta has published a step-by-step guide that provides much more detail on to how to get it working here:

Upvotes: 1

Related Questions