Deploy a widget

You can deploy a widget either by self hosting or using CyberArk hosting.

Embed a widget hosted by CyberArk

  1. Go to Apps & Widgets > Widgets, then select a configured widget or create one with your own customizations.

  2. In the Get Started tab of the widget configuration, select the specific web app to redirect the user to the application configured in the tenant. For more details, see Integrate a widget with the OIDC app.

  3. In the widget configuration, if you did not select an application from the drop-down list in the Get started tab, you can go to the Deploy tab and edit the success handler function to provide the path for the application.

  4. After saving the widget, copy the login page URL in the widget configuration and use it to redirect the user to this widget.

Embed the widget into your web app

You can download a full screen authentication widget HTML using the Download HTML button from the Deploy tab in the widget configuration section.

  1. Go to Apps & Widgets > Widgets and select a configured widget or create one with your own customizations.

  2. In the Get Started tab, select the web app where you want to embed the widget. For more details, see Integrate a widget with the OIDC app.

  3. In the configuration editor, enter ‘widgetHandler.onLoginSuccess’ as shown in the following screen.

    You can use either the web app or the success handler. If the web app and success handler are provided at the same time, the success handler takes preference over the web app.

  4. Copy the downloaded HTML content either to a Python IDE or to Notepad++.

  5. Host the authentication widget on your local host by creating a simple Python server as shown below.

    import http.server
    import socketserver
    
    class MyRequestHandler(http.server.SimpleHTTPRequestHandler):
    	def do_GET(self):
    		if self.path == '/':
    			self.path = 'LoginWidget.html'
    		return http.server.SimpleHTTPRequestHandler.do_GET(self)
    
    Handler = MyRequestHandler
    server = socketserver.TCPServer(('127.0.0.1', 8000), Handler)
    
    server.serve_forever()

    This code hosts the login widget on local host at port 8000.

  6. Navigate to the folder location where your HTML file and the .py file are stored and run the command python SERVER_FILE_NAME.py.

    This command starts the server and renders your authentication widget at http://localhost:8000/.

  7. Log in as a user.

    Once you are logged in successfully, you are redirected to the http://localhost:8000 URL with your authentication token.

    Make changes to the configurations on the admin portal to see them dynamically rendered on the widget.