Legacy Dev Forum Posts

 View Only

Sign Up

WEB API using the DLL OAuthWebBrowserForm

  • 1.  WEB API using the DLL OAuthWebBrowserForm

    Posted 06-05-2025 18:17

    robertosilva | 2020-04-27 22:12:18 UTC | #1

    Good evening.

    I developed a WEB API using the DLL OAuthWebBrowserForm. Within this WEB API I call the ShowDialog () method so that a screen is displayed for the User to enter his login and password. In development, inside Visual Studio everything works. However, when I put it on an IIS Server I get the following error message: Message: Showing a modal dialog box or form when the application is not running in UserInteractive mode is not a valid operation. Specify the ServiceNotification or DefaultDesktopOnly style to display a notification from a service application.

    Please, what am I doing wrong?


    tim.smith | 2020-04-27 22:30:07 UTC | #2

    That control is for desktop apps because that context doesn't natively use a web browser, which is required to authenticate users. Web apps are by definition in a web browser context, so a control that provides an embedded web browser won't work there.

    Since you're serving your app via IIS, I'm assuming it's a server-side web app of some sort, like ASP.NET. If so, you'll need to implement the auth code grant in your app. There's a tutorial for this for an ASP.NET MVC app: https://developer.mypurecloud.com/api/tutorials/oauth-auth-code/?language=csharp&step=1

    If your web app is a client-side app, the implicit grant should be used. There are tutorials in several languages for that, as well as the documentation: https://developer.mypurecloud.com/api/rest/authorization/use-implicit-grant.html


    system | 2020-05-28 22:29:18 UTC | #3

    This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.


    This post was migrated from the old Developer Forum.

    ref: 7653