We have already integrated Azure AD authentication in our ABP backend application for multitenancy.
Now, we are building a desktop client application, and we want this desktop app to authenticate users using the same Azure AD configuration.
Is there any official article or recommended approach for implementing the correct authentication flow for desktop applications in ABP with Azure AD?
3 Answer(s)
-
0
Hi,
Unfortunately, we don't have any documentation on this, but I've searched a bit on the web to help you and Entra (formerly Azure AD) seems to have some documentation on this.
See:
- https://learn.microsoft.com/en-us/entra/identity-platform/index-desktop
- https://learn.microsoft.com/en-us/entra/identity-platform/scenario-desktop-app-registration
Since this is not related to ABP and we do not have much experience on it, I cannot help more, but I hope the documents I have shared will be useful.
-
0
Hi berkansasmaz , We registered two apps on Azure, one for desktop and one for our ABP API The desktop client authenticates using Azure AD and gets the access token to access our API then, the desktop client calls our ABP API using the generated token, and we are able to get the user info
Now we want to register this user under the tenant, log him in, and return the token so the user can access our API using abp application user. How can we achieve this?
context.Services.AddAuthentication() .AddJwtBearer("AzureAdBearer", options => { options.Authority = ""; options.TokenValidationParameters = new TokenValidationParameters { ValidateIssuer = true, ValidIssuer = "", ValidateAudience = true, ValidAudience = "" }; }); [Route("api/app/desktop-auth")] [ApiController] [Authorize(AuthenticationSchemes = "AzureAdBearer")] // Important: require AzureAdBearer public class DesktopAuthController : DiyarSaaSController {}
-
0
Hi berkansasmaz , We registered two apps on Azure, one for desktop and one for our ABP API
The desktop client authenticates using Azure AD and gets the access token to access our API then, the desktop client calls our ABP API using the generated token, and we are able to get the user infoNow we want to register this user under the tenant, log him in, and return the token so the user can access our API using abp application user. How can we achieve this?
context.Services.AddAuthentication() .AddJwtBearer("AzureAdBearer", options => { options.Authority = ""; options.TokenValidationParameters = new TokenValidationParameters { ValidateIssuer = true, ValidIssuer = "", ValidateAudience = true, ValidAudience = "" }; }); [Route("api/app/desktop-auth")] [ApiController] [Authorize(AuthenticationSchemes = "AzureAdBearer")] // Important: require AzureAdBearer public class DesktopAuthController : DiyarSaaSController {}
Hi, did you check this community article?
If you did not please, first read it to see the related steps to use AzureAD for authentication in your application. If you stuck on any point, we can help you on the journey.
Regards.