bkright.blogg.se

Electron api demo
Electron api demo













electron api demo
  1. ELECTRON API DEMO INSTALL
  2. ELECTRON API DEMO CODE
  3. ELECTRON API DEMO FREE

But since, on Electron, you're only targeting Chrome, you're golden with whatever Chrome has available to you. This wouldn't be reliable in a cross-browser environment. The webkitdirectory attribute is there to enforce selecting only directories. Thus, if you want the user to select a directory from the UI, you can use a In Electron, you use HTML for your views. Note: This article has been substantially updated from Electron 0.37 to Electron 7 architecture and recommendations.

electron api demo

ELECTRON API DEMO CODE

You can find the example code from this tutorial in the okta-electron-javascript-example project on GitHub.Electron will give you a couple ways to open a directory from the filesystem. With Electron, you can use React, Vue, or Angular to create your UI and deploy it to desktops, mobile devices, and web applications. Learn more about Electron and OpenID ConnectĮlectron is an amazing technology that does more than just bring JavaScript to the desktop–it allows developers to create truly cross-platform applications. Once the application starts up, you can use your Okta credentials to log in and see the home.html page. You can find more usage information here. Side, please provide custom storageProvider or storageKey if advanced scenarios need to beįor development, this isn’t an issue in production you may want to consider implementing a custom storage provider for your application. WARN: Memory storage can only support simple single user use case on server You will see a warning in your console when starting: With your application ready, you can use the command npm start or run your debugger to see the application. But, by using the Okta SDKs you can securely authenticate your users, and push them into the application state you need. How you handle managing the application and user state is up to you. This could be a full-fledged React application or could have very little JavaScript at all. Electron doesn’t care what frontend you use. This page has been left intentionally simple for a very good reason. This helps verify that the user is logged in and who they signed in as. You are also displaying the user’s name from Okta. The logout button calls your electron API from the preload.js file. You will see output like the following when it’s finished:Ĭonst ) It will add the redirect URIs you specified and grant access to the Everyone group. The Okta CLI will create an OIDC Native App in your Okta Org. Your domain name is reversed to provide a unique scheme to open your app on a device. Use -133337:/callback for the Redirect URI and the Logout Redirect URI Select the default app name, or change it as you see fit. If you already have an account, run okta login.

ELECTRON API DEMO INSTALL

Install the Okta CLI and run okta register to sign up for a new account.

ELECTRON API DEMO FREE

Create an OpenID Connect applicationīefore you begin, you’ll need a free Okta developer account. This SDK exposes a signInWithCredentials() method that you can use to authenticate your users. There are many ways to handle this, but in this article, you will use Okta’s Auth JS SDK. For some companies, allowing localhost to receive the response from Okta may pose a security concern. In his example, he used AppAuth with its PKCE extension to secure his Electron application.īoth of these approaches require a callback path where Okta can send the authentication code to be processed by your application. Matt Raible wrote a blog post about using Electron with Okta in 2018. This process is super simple to set up and use securely. The middleware takes some configuration and connects with Okta. For example, one of the most common and popular ways to interface with Okta from a Node.js application is to use the Okta NodeJS OIDC Middleware. This can present a new set of challenges. Since Electron uses Node on the backend, it also has access to the entire npm ecosystem that Node developers have come to rely on.Įven though it is built on Node, Electron is used for desktop applications rather than web applications. This design enables developers to quickly write and easily maintain cross-platform applications between their desktop and web applications. Electron uses HTML, JavaScript, and CSS for its front end and Node.js for its backend. Electron is one of the most popular desktop frameworks today.















Electron api demo