Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Unsolved JWT authentication in WebEngineView

    QML and Qt Quick
    1
    1
    349
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • A
      audunls last edited by

      Hello,

      I am working on a project where I want to embed elements from a website in a QML application inside the WebEngineView-object.
      Our webapp uses JSONWebTokens for authentication, which is stored in the browser / localStorage along with the userId.

      We already use the API in our webapp for sending / recieving data using JSON to our cloud services, and to access the API we log in using a XmlHtttpRequest. This request returns userId and token, which in turn is stored in the QML application.

      Is there a way to pass this userId and token (two strings) from the QML application to localStorage in the WebEngineView so that you don't need to login both places? Or is there any other way to log in to a website inside a WebEngineView-object from a QML application? I was thinking about using the runJavaScript-function in WebEngineView, but have not found a solution yet.

      1 Reply Last reply Reply Quote 0
      • First post
        Last post