Skip to content
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

Kerberos Integrated auth #612

Closed
wants to merge 12 commits into from

Conversation

Suraiya-Hameed
Copy link
Member

@Suraiya-Hameed Suraiya-Hameed commented Sep 14, 2017

Tests to be added soon.

@Suraiya-Hameed
Copy link
Member Author

@tvrprasad @arthurschreiber Can you review it when possible?

@arthurschreiber
Copy link
Collaborator

Heya @v-suhame! 👋

I just opened #624, which proposes a better API for adding authentication providers (like the Kerberos provider you are working on here). Please check it out and let me know what you think! ❤️

@@ -46,7 +46,8 @@
"iconv-lite": "^0.4.11",
"readable-stream": "^2.2.6",
"sprintf": "0.1.5",
"sspi-client": "^0.1.0"
"sspi-client": "^0.1.0",
"node-kerberos": "^0.0.25"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As mentioned in #624, I don't think having all these different libraries be dependencies of tedious is a scalable approach.


// clean kerberos security context if exists
if (this.kerberos && this.context) {
this.kerberos.authGSSClientClean(this.context, () => { cleanConnection(); });
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you think about cleaning the kerberos context right after the security handshake was performed successfully? 🤔

@@ -1533,6 +1616,39 @@ Connection.prototype.STATE = {
}
}
},
SENT_LOGIN7_WITH_KERBEROS: {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The state machine is starting to get really complicated. Do you think kerberos authentication could be implemented without adding a new state? I know that there is also a special state for NTLM authentication defined, but while working on #624, I was thinking if we maybe could get rid of authentication specific states somehow. 🤔

@@ -1057,6 +1101,41 @@ class Connection extends EventEmitter {
}
}

processLogin7KerberosResponse() {
if (this.loggedIn) {
return this.dispatchEvent('loggedIn');
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe I'm missing something, but is this really the right location for this call? Where is this.loggedIn set to true for kerberos authentication? 🤔

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I think I figured out where this happens. 😓

this.sspiClientResponsePending = false;

// clear the ntlmpacket
delete this.ntlmpacketBuffer;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deleting properties has negative performance implications in V8, if I remember correctly. 🤔

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure, I'll double check that.

@Suraiya-Hameed
Copy link
Member Author

@arthurschreiber Thanks for reviewing it :) I'll keep this PR open for now, will make the necessary changes after pluggable-auth-providers gets merged.

@Fadoli
Copy link

Fadoli commented Jan 28, 2019

Hey just asking, not work is planned on this anymore ? (since the pluggable auth providers is okay ish ?)

@David-Engel
Copy link
Member

@Fadoli Changes from this PR look to be incorporated in #624 which is still open.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants