Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

67 lines
1.7 KiB

  1. ///////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright (c) Microsoft Corp. All rights reserved.
  4. //
  5. // FILE
  6. //
  7. // IdentityHelper.h
  8. //
  9. // SYNOPSIS
  10. //
  11. // This file declares the class IdentityHelper.
  12. //
  13. ///////////////////////////////////////////////////////////////////////////////
  14. #ifndef IDENTITYHELPER_H_
  15. #define IDENTITYHELPER_H_
  16. #pragma once
  17. #include "iastlutl.h"
  18. ///////////////////////////////////////////////////////////////////////////////
  19. //
  20. // CLASS
  21. //
  22. // IdentityHelper
  23. //
  24. // DESCRIPTION
  25. //
  26. // Implements a request handler that converts the RADIUS User-Name
  27. // attribute to a fully qualified NT4 account name.
  28. //
  29. //
  30. ///////////////////////////////////////////////////////////////////////////////
  31. class IdentityHelper
  32. {
  33. public:
  34. IdentityHelper() throw();
  35. ~IdentityHelper() throw();
  36. HRESULT initialize() throw();
  37. bool getIdentity(IASRequest& request,
  38. wchar_t* pIdentity,
  39. size_t& identitySize);
  40. protected:
  41. HRESULT IASReadRegistryDword(
  42. HKEY& hKey,
  43. PCWSTR valueName,
  44. DWORD defaultValue,
  45. DWORD* result
  46. );
  47. private:
  48. void getRadiusUserName(IASRequest& request, IASAttribute &attr);
  49. DWORD overrideUsername; // TRUE if we should override the User-Name.
  50. DWORD identityAttr; // Attribute used to identify the user.
  51. PWSTR defaultIdentity; // Default user identity.
  52. DWORD defaultLength; // Length (in bytes) of the default user identity.
  53. static bool initialized;
  54. };
  55. #endif // IDENTITYHELPER_H_