Single Sign On integration

Add-in Express™ Support Service
That's what is more important than anything else

Single Sign On integration
Excel Addin 
Subscribe
Ming Chao




Posts: 34
Joined: 2019-01-23
Hi,

For our Excel Add-in product, we would like to implement single sign-on (SSO), similar to signing in with a social media account (e.g., Google). This would allow users to click an SSO button to sign in automatically if they’re already authenticated, or otherwise, they would be directed to a sign-in screen to complete the authentication process.

Currently, our Excel Add-in has a login screen where users enter their username and password. This sends a POST request to our server, which responds with an OAuth2 token that the add-in uses for all API requests.

With SSO, we envision the following workflow:
1. Add an SSO login button on the login screen.
2. When the button is clicked, the default browser opens and navigates to our authentication provider.
3. The user completes the authentication process in the browser, which is independent of the add-in.
4. Upon completion, the authentication provider redirects to a URL containing the token or other necessary data to complete authentication within the add-in.

Our challenge is finding a way to pass data back to the add-in from the browser after authentication. I would appreciate any insights or recommendations on implementing SSO for our add-in.

TIA,
Ming
Posted 07 Nov, 2024 14:25:53 Top
Ming Chao




Posts: 34
Joined: 2019-01-23
To simplify my question, I'm looking for ways for a browser to communicate with the add-in.

I would like the add-in to handle the authorization code flow of the OAuth process. After authorization, it should redirect to another URL with the code parameter in the URL, so that the add-in can use it to request an OAuth token.

Ideally, I would like to use a custom protocol (the redirect URL) that allows the browser to invoke and send data (the URL) back to the add-in without any intermediate process. A Stack Overflow post described how this is possible for a standalone C# application, but can an add-in handle it in a similar way?

https://stackoverflow.com/questions/30582835/how-do-i-retrieve-a-url-protocol-request-in-c-sharp

I’m not looking for the browser to start the application but for the add-in to be able to handle this when it's already open, more like a listener setup.

Another options I've considered is an embedded WebView but it may negatively affect the user experience in my application.
Posted 10 Nov, 2024 13:29:21 Top
Ming Chao




Posts: 34
Joined: 2019-01-23
To simplify my question, I'm looking for ways for a browser to communicate with the add-in.

I would like the add-in to handle the authorization code flow of the OAuth process. After authorization, it should redirect to another URL with the code parameter in the URL, so that the add-in can use it to request an OAuth token.

Ideally, I would like to use a custom protocol (the redirect URL) that allows the browser to invoke and send data (the URL) back to the add-in without any intermediate process. A Stack Overflow post described how this is possible for a standalone C# application, but can an add-in handle it in a similar way?

https://stackoverflow.com/questions/30582835/how-do-i-retrieve-a-url-protocol-request-in-c-sharp

I’m not looking for the browser to start the application but for the add-in to be able to handle this when it's already open, more like a listener setup.

Another options I've considered is an embedded WebView but it may negatively affect the user experience in my application.

Thanks,
Ming
Posted 10 Nov, 2024 13:30:52 Top
Andrei Smolin


Add-in Express team


Posts: 19011
Joined: 2006-05-11
Hello Ming,

Single sign-on is lies outside of the scope of Add-in Express. It doesn't belong to the functionality Add-in Express provides nor to the functionality offered by any of the Office object models.

Ming Chao writes:
I'm looking for ways for a browser to communicate with the add-in.


An external executable can invoke a public method/property declared on the add-in module; that is, this possibility exists if only we talk about an Add-in Express based COM add-in.

So, is your Excel add-in a COM add-in?

Regards from Poland (GMT+1),

Andrei Smolin
Add-in Express Team Leader
Posted 12 Nov, 2024 09:01:14 Top
Ming Chao




Posts: 34
Joined: 2019-01-23
Hi Andrei,

Yes, it's a COM add-in. Could you please elaborate on the public method/property you mentioned?

Thanks,
Ming
Posted 12 Nov, 2024 13:36:17 Top
Andrei Smolin


Add-in Express team


Posts: 19011
Joined: 2006-05-11
Hello Ming,

Below is a citation from the Add-in Express manual; see section Accessing public members of your COM add-in from another add-in or application; see the PDF file in the folder {Add-in Express}\Docs on your development PC.

You can access a public property or method defined in the add-in module via the following code path:

HostApp.COMAddins.Item({ProgID}).Object.MyPublicPropertyOrMethod(MyParameter)

The ProgID value above can be found in the ProgID attribute of the add-in module. Note that you access the MyPublicPropertyOrMethod above through late binding - see System.Type.InvokeMember.


See also https://www.add-in-express.com/creating-addins-blog/standalone-application-addin-communicate/.

Regards from Poland (GMT+1),

Andrei Smolin
Add-in Express Team Leader
Posted 12 Nov, 2024 15:43:09 Top