# \[solved\] Using login flow with electron

**URL:** <https://help.nextcloud.com/t/solved-using-login-flow-with-electron/51716>\
**Category:** ℹ️ Support\
**Tags:** authentication\
**Created:** [April 16, 2019, 5:45am UTC](https://help.nextcloud.com/t/solved-using-login-flow-with-electron/51716 "2019-04-16T05:45:47Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ochorocho](https://help.nextcloud.com/user_avatar/help.nextcloud.com/ochorocho/32/14798_2.png) [@ochorocho](https://help.nextcloud.com/u/ochorocho)\
**Post date:** [April 16, 2019, 5:45am UTC](https://help.nextcloud.com/t/solved-using-login-flow-with-electron/51716/1 "2019-04-16T05:45:47Z")

</div>

Hey,

i have built a little plugin for KAP Screenrecorder to be able to share generated videos/gif to Nextcloud. This works so far. 🙂

Due to the fact that i implemented username and password authentication which is not a perfect solution i want to use Nextclouds login flow ( [https://docs.nextcloud.com/server/14/developer\_manual/client\_apis/LoginFlow/index.html#obtaining-the-login-credentials](https://docs.nextcloud.com/server/14/developer_manual/client_apis/LoginFlow/index.html#obtaining-the-login-credentials) )

What i have so far:

- Open a Window/Webview to `/index.php/login/flow` with `OCS-APIREQUEST` and `USER_AGENT` set
- User can login and grant permissions according to the login

I struggle getting the `nc://...` URL from my electron webview.

Is it correct, that i will finally get redirected to a URL starting wirh `nc://` ?  
From this URL i need to extract the credentials?  
What will a call to the API look like when a user is already logged in?

Thanks for your support.

---

<div class="post-metadata">

**Author:** ![ochorocho](https://help.nextcloud.com/user_avatar/help.nextcloud.com/ochorocho/32/14798_2.png) [@ochorocho](https://help.nextcloud.com/u/ochorocho)\
**Post date:** [April 22, 2019, 1:15am UTC](https://help.nextcloud.com/t/solved-using-login-flow-with-electron/51716/2 "2019-04-22T01:15:16Z")

</div>

Only need to register a custom protocol for electron. Works as described in the docs. Thanks 🙂

```auto
        protocol.registerStringProtocol('nc', function (request, callback) {
            // Do something when protocol is nc://
        }, function (err) {

        });

```

---

<div class="post-metadata">

**Author:** ![wwe](https://help.nextcloud.com/user_avatar/help.nextcloud.com/wwe/32/72963_2.png) [@wwe](https://help.nextcloud.com/u/wwe)\
**Post date:** [December 4, 2024, 9:45am UTC](https://help.nextcloud.com/t/solved-using-login-flow-with-electron/51716/3 "2024-12-04T09:45:46Z")

</div>



---

<div class="post-metadata">

**Author:** ![wwe](https://help.nextcloud.com/user_avatar/help.nextcloud.com/wwe/32/72963_2.png) [@wwe](https://help.nextcloud.com/u/wwe)\
**Post date:** [December 11, 2024, 2:49pm UTC](https://help.nextcloud.com/t/solved-using-login-flow-with-electron/51716/4 "2024-12-11T14:49:24Z")

</div>


