security_credentials.js 761 B

12345678910111213141516171819202122
  1. var SecurityCredentialsNative = require('../../../build/Release/kerberos').SecurityCredentials;
  2. // Add simple kebros helper
  3. SecurityCredentialsNative.aquire_kerberos = function(username, password, domain, callback) {
  4. if(typeof password == 'function') {
  5. callback = password;
  6. password = null;
  7. } else if(typeof domain == 'function') {
  8. callback = domain;
  9. domain = null;
  10. }
  11. // We are going to use the async version
  12. if(typeof callback == 'function') {
  13. return SecurityCredentialsNative.acquire('Kerberos', username, password, domain, callback);
  14. } else {
  15. return SecurityCredentialsNative.aquireSync('Kerberos', username, password, domain);
  16. }
  17. }
  18. // Export the modified class
  19. exports.SecurityCredentials = SecurityCredentialsNative;