question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How can I get tenant filtered data using Odata Controller ?

See original GitHub issue
[DontWrapResult]
    public class UsersController : AbpODataEntityController<User, long>, ITransientDependency
    {
        public UsersController(IRepository<User, long> repository)
        : base(repository)
        {
        }
    }

Above is my odata controller, Its not filtering by tenantId.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
acjhcommented, Jul 5, 2018

Add [AbpMvcAuthorize] attribute to your controller.

1reaction
ismcagdascommented, Jun 29, 2018

@Bijayakumar1990 you can use [AbpAuthorize] attribute to authorize your controller. Then, you need to authanticate using TokenAuth controller, get a token and send this token in every request on the request headers.

https://aspnetboilerplate.com/Pages/Documents/Zero/Startup-Template-Angular#token-based-authentication

Read more comments on GitHub >

github_iconTop Results From Across the Web

Using OData with RESTful URI Parameters and Multitenancy
I love OData for GET requests, but prefer to use REST for POST, PUT, DELETE. OData makes pagination, filtering, etc. on the frontend...
Read more >
Querying Odata controller returns data from all tenants # ...
MVC verions v11.1.0 Hello I have implemented the Odata like this: [AbpAuthorize] public class MetricHeadController ...
Read more >
OData Analytics query guidelines - Azure DevOps
You can do so in the regular $filter clause for simple navigation properties. For example, the following query explicitly asks for ...
Read more >
odata - Filter multi-tenant data with RESTier
I'd like to expose an OData service over this database using RESTier, where each request to my service will include a JWT that...
Read more >
Basic Tutorial · OData - the Best Way to REST
The $filter system query option allows clients to filter a collection of resources that are addressed by a request URL. The expression specified...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found