Open Closed

integrate desktop client application with abp external login #9215


User avatar
0
i.atta created

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)
  • User Avatar
    0
    berkansasmaz created
    Support Team .NET Developer

    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.

  • User Avatar
    0
    i.atta created

    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
    {}
    
  • User Avatar
    0
    EngincanV created
    Support Team .NET Developer

    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 
    {} 
    

    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.

Boost Your Development
ABP Live Training
Packages
See Trainings
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v9.3.0-preview. Updated on May 15, 2025, 10:28