Api with tenant #101
Replies: 7 comments 2 replies
-
so far so good. I can create database for webApi project from example 3. |
Beta Was this translation helpful? Give feedback.
-
Yes, using webApi is the best way to build a blazor app that uses AuthP's backend code. You might find the AuthP's following documentation useful: Also, if you want to use AuthP's Roles / Permissions to control access then you might find this section about you can get the user's permissions in your blazor side. This allows your frontend only show the features that the current user can access. |
Beta Was this translation helpful? Give feedback.
-
Yes I can use the new feature of NET 8 Identity Endpoints and use cookie authentication or bearer Token. So to use Authp , you dont have to use Jwt token. There is one thing you must be aware that EmailConfirmed in AspNetusers must be set to true or else it wont work. I have converted the mvc controller GetTenatnList with permission Example3Permission.TenantList to api controller.
Login with cookie : The result : Now it will be easier to use Authp in blazor. Thanks to new feature of NET 8. Actually I am still very curious how to use authp in blazor ssr which is almost the same as razor pages. |
Beta Was this translation helpful? Give feedback.
-
I know now why EmailConfirmed must be set to true to make it works. It is because I set it in program.cs.
|
Beta Was this translation helpful? Give feedback.
-
It is still too early if there is a possibility to use blazor NET8 for implementing Authp. But so far so good. I only tried one function to Get TenantList. First I create webApp in NET 8 and choose Automatic render mode = none. LoginResultYes I know I still have a problem with TenantRolesNames - it shows only the collection. I will solve it latter. ##Permission## As you see from the picture to apply permission use :
|
Beta Was this translation helpful? Give feedback.
-
Good progress. Looks like you found all the parts to make your multi-tenant app with a blazor frontend. |
Beta Was this translation helpful? Give feedback.
-
I find a way how to add Additional Field in IdentityUser. I just want to add DateCreated to IdentityUser. So I just add it to The Migration.
|
Beta Was this translation helpful? Give feedback.
-
The only Example I can create for blazor app is Example 2. Can I use Example3 for web api ? Because that is the only way I know how to implement Authp in blazor application.
Beta Was this translation helpful? Give feedback.
All reactions