-
Notifications
You must be signed in to change notification settings - Fork 15.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for basic auth #3250
Conversation
Nice, will this fix proxy authentication too? |
This is awesome! ❤️ |
Yeah. |
@zcbenz This is great work, thank you so much! |
😍 |
Thanks @zcbenz. I'm hoping this will work with Windows Authentication via IIS. If anyone could build this on Windows it would be much appreciated! I'm in a corporate environment and it's just a pain to get all the dependencies installed! |
Thanks for this update ! Being new on Electron I'm wondering a few things if anyone could help ?
Thanks for any help guys ;) |
Would this open a connection modal asking for credentials (like we have in browsers) or is it something that we need to implement somehow ? |
@clarkey I fixed this in 0.34.1, but you need to call an extra method to enable it: https://github.com/atom/electron/blob/master/docs/api/app.md#appallowntlmcredentialsforalldomainsallow |
@paulcbetts Thanks buddy. Got this working on the 0.34.2 release without using |
@zcbenz Is there any way to add this event in webviews? |
Hi all, I am new to electron. I am wondering when the event 'login' is triggered. And what does the 'login' even mean in here? Couple lines of example codes are appreciated. Thanks. |
this doesn't fix proxy issue. Event is getting fired, but after authorisation nothing happens if you run proxy from window other than main browser. |
How do we trigger a modal to prompt for input? |
Will be nice to clear auth credentials. For example, I'm using a proxy that accepts options via username:
So, if I want to change the peer node, I change my name:
But, I'm not changing the proxy, so electron has valid credentials and is not going to trigger I'm searching the way to clean auth settings so electron asks them again. (I have created a feature request: #8089) |
Hello, This doesn't seem to work on the Thanks EDIT: it works if you call |
Hello, |
Clear auth data is fixed in electron 1.4.12: |
webContent returned in the function has |
Is there any suggested workflow for incorrect credentials getting sent to the callback? Currently I have a workflow where if a user trys to click a link to one of my Basic Auth pages it pops a modal over the new window with a login prompt. Assuming I enter correct credentials it works as expected however there doesn't seem to be any way of knowing if the user passed invalid credentials at which point I end up with a blank window. Has anyone else run into this problem and/or is there something obvious i'm missing? |
Getting Error while implementing basic authentication:
Error occurs when I try to cancel first time and submit next time, so in short login event is fired twice.Please help what am I doing wrong. |
You should do nothing when user cancels login. Like said by Electron, you cannot call |
Close #1362
Close #625
Event: 'login'
Returns:
event
EventwebContents
WebContentsrequest
Objectmethod
Stringurl
URLreferrer
URLauthInfo
ObjectisProxy
Booleanscheme
Stringhost
Stringport
Integerrealm
Stringcallback
FunctionEmitted when
webContents
wants to do basic auth.The default behavior is to cancel all authentications, to override this you
should prevent the default behavior with
event.preventDefault()
and callcallback(username, password)
with the credentials.