-
Notifications
You must be signed in to change notification settings - Fork 145
Add support for certificate based confidential client auth. acquireTokenWithClientCertificate #32
Conversation
… thumbprint. The jwt-simple lib doesn't provide a way to do that. Switching to customer implementation.
…ue by trimming the path from any hosts passed to nock.
Conflicts: test/util/util.js
… jwt matches what was expected given static inputs.
* @param {string} thumbprint A hex encoded thumbprint of the certificate. | ||
* @param {AcquireTokenCallback} callback The callback function. | ||
*/ | ||
AuthenticationContext.prototype.acquireTokenWithClientCertificate = function(resource, clientId, certificate, thumbprint, callback) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We abstract out client certificate using class ClientAssertionCertificate which has the Sign method (and maybe a hash method). This way, the object can be created differently on different platforms and the API still have the same OM.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We also have another class named ClientAssertion and an AcquireToken API for it, so developer can create the assertion once and pass it multiple times.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One idea we discussed in the API review meetings was to get rid of ClientAssertionCertificate and add a factory method (or constructor) to ClientAssertion to create it using a certificate.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@afshins I don't think that the ClientAssertionCertificate class makes sense in Node. There is only one kind of certificate in Node and that is a PEM file. There is no need to create the cert differently on different platforms.
I can get to the version that accepts an already generated assertion later. I don't think we need to block this update on that particular version.
In general, Node is much lighter weight than C#, and generally doesn't involve a whole lot of classes. Since there is no static type checking it doesn't make as much sense to have a bunch of classes. In node strings are acceptable. I believe that it would be unnatural in node to force the developer to deal with a bunch of other classes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fair enough. We need to make OM natural to the platform, so feel free to follow the common pattern.
Sign off |
Add support for certificate based confidential client auth. acquireTokenWithClientCertificate
No description provided.