I want to fetch user data from web site administration tool for managing users in my application. Is it possible to set table in SQL Server 2008 by using Model?
I want to display the user information in table.
Thanks.
The purpose of using the Membership API is that you access the data via the API. This abstracts the Membership system from the physical implementation, so the implementation can change without your app caring.
If you want the list of users, then do this:
var users = Membership.GetAllUsers();
Users is a MembershipUserCollection, which you can then use to access the data and populate your UI.
Related
I have an ASP.NET Core application where users need to log in using Azure AD. I have implemented this as described in the Microsoft documentation:
https://learn.microsoft.com/en-us/azure/active-directory/develop/quickstart-v2-aspnet-core-webapp-calls-graph
There's a database attached to the application, in which I have described user roles, and based on those roles I want to fill in what is visible, what the user can do, etc.
How can I add the data from the database to the session after logon, so I have access to that data on every page?
We are having multi tenant web application designed in asp.net mvc. Our database is stored on Azure. We have created security policy in the database so no client can see data of another client, and in every table we have tenant id for each entry.
We have created some dashboards using power bi, data is being accessed using sql stored procedure which has tenant id parameter.for testing purpose i supply tenant id while running dashboards inside power bi desktop. Now we are trying to integrate those dashboards to our web application. for this we have done necessary changes in the web.config file.
Issue is how will we supply tenantID for which user is logged in to power bi so that user can see data for that particular client only?
Thanks in advance.
It depends on the storage mode of your report (Imported or DirectQuery) and how it will be integrated in your app (Embedded API, Publish to web (public) or Secure embed).
If the storage mode is Imported, this means that your report contains a copy of the data. The consequence is that you can't query the database and get the data based on the current user, because the copy of the data is one and it is shared with all users, which are looking at your report. So the data should be for all tenants and you must filter it in each users session. The filtering can be made in two ways - by adding a "normal" report level filter or by implementing Row-level security (RLS).
Filtering can be achieved by passing the filter in the URL or defining the filter in the embedded configuration. First one can be used with Secure embed, while the later one is applicable when using Embedded API. Note, that Publish to web method doesn't support URL filters. Important part is that the filter added this way will be visible in the Filters pane and the user can modify it or remove it (so it's not a good way to secure your data). If you are embedding the report using the API, you can hide the Filters pane by setting filterPaneEnabled: false in the embed config, but this will also hide all other filters and the end user will be able to slice the data only with the visuals provided by you (e.g. slicers in the report). Also note, that secure embed requires each of the viewers of your report to have Power BI Pro license
(or if the workspace where you publish the report has a dedicated capacity assigned, i.e. Power BI Premium or Power BI Embedded, a Power BI Free license).
With RLS, you will include all the data for all tenants in your report, and Power BI will filter it for you, so the user will see only the data relevant for his tenant. This can be made it two ways - define a role for each tenant and include your end users in the corresponding role, or use userprincipalname() DAX function in your report to filter the data based on the current user.
My recommendation is to use RLS, and the benefit in this case is that there will be a single report to embed and no parameters needs to be passed to it from your app at all.
My client requirement is to implement application as same application with different database as Multi Tenant application.
As per requirement, different user can access same application but as per user identity he will be connecting to different database to access company specific details. each company has different database.
I would be planning this with Asp.Net MVC, EntitiyFramework with database first (as database already exist) but I am not sure will able to handle this as multitenant app. Can you please guide or give me any direction or sample if already implemented.
Thanks
Nik
I am using QuickBooks web connector and i am trying to get company data. For that I created a service which is communicating with web connector and getting all the data.
What i tried so for:
I am selecting .qwc file using web connector. Just for testing am quiring only customer data and storing into notepad.
i am using asp.net application. From that application i will give the option to select to the end user: like
Customers 2.vendors 3. items like check boxes. Based on the selection i have to get the related data using web connector.
MY problem is : how can i intercat my application to web connector...how can i get the data what end user is selcted from asp.net application.
Let me know if question is clear or not ....
I started my project using ASP.NET SIMPLE MEMBERSHIP. Now I have the necessity to create a WPF application which can add users to SIMPLEM MEMBERSHIP tables.
In the ASP.NET, I've identified that this is the function to create new accounts:
WebSecurity.CreateUserAndAccount(model.UserName, model.Password);
What would you suggest to implement this feature in a desktop application. I was thinking creating a WCF Web Service, but I don't know how difficult could be creating it.
You could use WCF but probably the simplest solution is to include the Asp.net Simple Membership Tables as part of an Entity Framework Model and use the model from within your WPF app. Check out this post for more details.
That would, of course, require direct access to your SQL Server and either a SQL Server account with access to the tables referenced from the EF model would have to be used or the app users would have to have access to the SQL Server through integrated security (if using mixed mode authentication with your SQL Server).
Why bother?
I would simply have yours users go to a link and register for an account online through an asp.net page. Once registered, offer the WPF/windows client as a download. This stuff is already pretty much all built-in.
That link might help: http://weblogs.asp.net/jgalloway/archive/2012/08/29/simplemembership-membership-providers-universal-providers-and-the-new-asp-net-4-5-web-forms-and-asp-net-mvc-4-templates.aspx