Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. JWT authentication in WebEngineView
Qt 6.11 is out! See what's new in the release blog

JWT authentication in WebEngineView

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
1 Posts 1 Posters 583 Views 1 Watching
  • 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 Offline
    A Offline
    audunls
    wrote on last edited by
    #1

    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
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved