OIDC - How to link api user to local app repository entities

I have a React front-end using the okta-react sdk (6.0.0), with a .NET Core 3.1 web api. My question surrounds the best practice flow to add/link the OIDC user to my local identity store.

Here’s an older post by the Okta Team that somewhat sheds light on what I’m shooting for. Build a CRUD App with ASP.NET Core and Angular | Okta Developer. However I have a couple questions…

  1. Because the uid/sub is in the claim, it obviously doesn’t need to be sent in the route. However can it still be considered legit to have routes that actually send the uid/sub in the route, and for example, look something like


  1. If I wanted to add social login functionality, do backend entities also need to be queried by provider in addition to the uid/sub? For example,
        .Where(u => u.UserId == userId && u.Provider == "okta")

Any guidance would be appreciated!

I think not adding the given entity id in the route is what’s getting me. Using a second canonical example, if I wanted to get all books for a given author, I would do something like the below.

public IQueryable<Book> GetBooksByAuthor(int authorId)
    return db.Books.Include(b => b.Author)
        .Where(b => b.AuthorId == authorId)

In this example, the authorId is passed in the route. So, in the Okta example, to get all workouts for a given “gymMember”, I would expect to have a route of


I completely understand that the “gymMember”/user claim is available without needing to send it via the route, but how can this be done so it’s a bit more natural?

Hope this makes sense :slight_smile: