Which MSAL library for a plugin for an electron app?

Shawn s 0 Reputation points
2023-09-07T05:54:01.0133333+00:00

Hi,

I'm struggling to wade through the graph and msal documentation for a project I'm doing. I want to help users sync between logseq and microsoft to do. Logseq is an electron application with a plugin ecosystem. I believe the plugins run on the render process.

I'm currently trying to follow the react msal tutorial because it's fairly common to use react to build plugins for logseq. However I'm getting errors no matter what I try. If the sign in popup appears, it either goes blank completely after entering my email, or it gives an issue with the redirectUri. Speaking of that, how do you decide on a redirectUri? The furthest I got was using https://login.microsoft.online/${'YOUR_TENANT_ID'} as my redirectUri, but this requires specifically adding users' emails to the app. That's very much not an option as I plan to release this for anyone to use.

It's very confusing, I'd appreciate any help.

Thank you

Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
21,308 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Shweta Mathur 29,741 Reputation points Microsoft Employee
    2023-10-03T05:47:38.49+00:00

    Hi @Shawn s ,

    Thanks for reaching out.

    I understand that you are building electron application and confuse about redirect URI while configuring your application.

    Regarding the redirectUri, it's important to note that the redirectUri is the URI that the Microsoft identity platform will redirect the user to after they have authenticated. This URI you are configuring in your application must be registered in the Azure portal for your application.

    After authentication, you can redirect the users to your application's page.

    As for how to decide on a redirectUri, you can use any valid URI that you have access to. If you are developing locally, you can use a localhost URI such as http://localhost:3000/. If you are deploying your application, you can use your application’s domain name as the redirectUri.

    You shouldn't use ${'YOUR_TENANT_ID'} directly as part of your redirect URI. Instead, you should have a consistent redirect URI that your app uses, and it should be configured in your app registration on the Azure portal.

    Reference - https://learn.microsoft.com/en-us/azure/active-directory/develop/reply-url

    Hope this will help.

    Thanks,

    Shweta


    Please remember to "Accept Answer" if answer helped you.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.