Thanks liangshiwei,
I have already considered your method, but the issue is:- my client want to assign users or roles to individual Application. The method you have suggested allow users to access all applications in OpenIddictApplication.
My undressing is if I add a new N-2-N property "AppUser" in OpenIddictApplication, then each application created in OpenIddictApplication, I can select individual user, the trouble is I am getting below error at AddOrUpdateProperty<IdentityUser>
The type or namespace name 'IdentityUser' could not be found (are you missing a using directive or an assembly reference?) [Acme.BookStore.Domain.Shared]
private static void ConfigureExtraProperties()
{
OneTimeRunner.Run(() =>
{
ObjectExtensionManager.Instance.Modules()
.ConfigureOpenIddict(openIddictApplication =>
{
openIddictApplication.ConfigureApplication(application =>
{
application.AddOrUpdateProperty<IdentityUser>( //property type: IdentityUser
"AppUser", //property name
property =>
{
property.UI.Lookup.Url = "/api/identity/users";
property.UI.Lookup.DisplayPropertyName = "userName";
}
);
});
});
});
. . If you believe that above is not the right way, then please suggest how can I achieve it? . . Regards, Navneet
Hi liangshiwei,
So far I manage to build below but there are some issues I am facing:
a) in below is not resolving error: The type or namespace name 'IdentityUser' could not be found (are you missing a using directive or an assembly reference?) [Acme.BookStore.Domain.Shared]
private static void ConfigureExtraProperties()
{
OneTimeRunner.Run(() =>
{
ObjectExtensionManager.Instance.Modules()
.ConfigureOpenIddict(openIddictApplication =>
{
openIddictApplication.ConfigureApplication(application =>
{
application.AddOrUpdateProperty<IdentityUser>( //property type: IdentityUser
"AppUser", //property name
property =>
{
property.UI.Lookup.Url = "/api/identity/users";
property.UI.Lookup.DisplayPropertyName = "userName";
}
);
});
});
});
b) Do you think below code is sufficient to create a dedicated column in database
ObjectExtensionManager.Instance
.MapEfCoreProperty<OpenIddictApplication, IdentityUser>(
"AppUser"
);
c) Most time was taken to read https://docs.abp.io/en/abp/latest/Authorization, but it was worth reading :-). what I understand is Permission like CRUD can be design but that is for Entity level, however I need to define permission for each application created in Volo.Abp.OpenIddict.OpenIddictApplication Individual Application created in OpenIddictApplication
Regards, Navneet
Many thx,
Let me give a try and will come back to you
Hi,
You can use the ASPNET Core standard middleware to do it, it's not related to ABP : https://learn.microsoft.com/en-us/aspnet/core/fundamentals/middleware/?view=aspnetcore-7.0
Hi liangshiwei,
Sorry, maybe I wasn't clear, how can i configure Application to allow certain users only
Regards, Navneet
Hi liangshiwei,
That I have done it, but how to intercept in middleware to allow or restrict the access
Regards Navneet
Hi liangshiwei,
Any update on how to achieve on point number 4
Regards, Navneet
Hi,
Should be:
https://github.com/NavneetProject/abp-commercial-docs/tree/{version}
Not https://github.com/NavneetProject/abp-commercial-docs/tree/1.0.0 .
. . Many thanks, it was easy fix. . .
. .
4
Replace OpenIddictApplication.cs with myOpenIddictApplication.cs Replace OpenIddictDbContextModelCreatingExtensions.cs with myOpenIddictDbContextModelCreatingExtensions.cs
You can't replace the OpenIddictApplication entity with your own. you can consider using the object extensions system: https://docs.abp.io/en/abp/latest/Customizing-Application-Modules-Extending-Entities
. .
In regards to point number number 4, if you need details info, I can send you by email due to client confidential codes. However, summary is below:
As ABP Commercial has OpenID module to add application via UI, my client is looking to add new application & assign Users or Roles to the application so that my client can control the access to application.
How can I achieve without replacing OpenID module code as I my license don't allow to download source code?
Regards, Navneet
Please try:
https://github.com/NavneetProject/abp-commercial-docs/tree/{version}
. . Hi Liangshiwei, I have tried exactly, but didn't work, I have send you GitHub token and Github User Agent by email