Skip to content

How to properly implement Auth0 for permissions/scopes? #2028

Closed Locked Answered by raman-m
Timur-Lenk asked this question in Q&A
Discussion options

You must be logged in to vote

Hi Timur!
Welcome to Ocelot world! 🐯

So, I see that your Auth0 lib and its provider supports JWT tokens, right? Good!


.AddJwtBearer(options => {...}

JWT setup looks good!

I'm worrying only about NameClaimType = ClaimTypes.NameIdentifier... Why do you need this option?


      "AuthenticationOptions": {
        "AuthenticationProviderKey": "Bearer", // this is obsolete property, use AuthenticationProviderKeys !
        "AllowedScopes": ["read:posts"]
      }

According to our Authentication docs we recommend to use the AuthenticationProviderKeys property, for the long term configs.


Regarding ocelot.json

    { // authenticated route
      "UpstreamPathTemplate": "/api/posts",
      // ...

Replies: 1 comment 7 replies

Comment options

You must be logged in to vote
7 replies
@Timur-Lenk
Comment options

@raman-m
Comment options

@Timur-Lenk
Comment options

@raman-m
Comment options

@raman-m
Comment options

Answer selected by raman-m
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
Authentication Ocelot feature: Authentication
2 participants