How to get scope

Question closed without any agreement, so restarting in a new thread

Suggested - Auth0 Angular SDK Quickstarts: Call an API

But code is similar to - Auth0 Angular SDK for Single Page Apps

  // The AuthHttpInterceptor configuration
  httpInterceptor: {

      // Matching on HTTP method
        uri: '/api/orders',
        httpMethod: 'post',
        tokenOptions: {
          audience: 'http://my-api/',
          scope: 'write:orders',

Why is scope passed? I thought it should be coming from the user session
Also the main problem is , spring end point is not getting claims/scope

See this explanation at Auth0 Angular SDK for Single Page Apps :

tokenOptions is passed directly to the getTokenSilently method on the underlying SPA SDK. Please see the documentation for more detail on the properties that are accepted.

So the httpInterceptor will pass the scope and audience in tokenOptions to the getTokenSilently method, to obtain a valid token to make the request (to /api/orders). getTokenSilently can use these values to ensure that the cached access token or refresh token satisfy the requirements (appropriate API and optional scope), or get a new token if it’s necessary.