unit Chilkat.OAuth2;

{
  Pascal wrapper for Chilkat OAuth2.
  Auto-generated by PascalWrapperGenerator -- do not edit manually.
}

{$IFDEF FPC}
  {$MODE DELPHI}
{$ENDIF}

interface

uses
  SysUtils,
  Chilkat.Base;

type

  { TOAuth2 wraps CkOAuth2 via the C bridge layer. }
  TOAuth2 = class(TChilkatBase)
  private
    FOnAbortCheck: TChilkatAbortCheckEvent;
    FOnPercentDone: TChilkatPercentDoneEvent;
    FOnProgressInfo: TChilkatProgressInfoEvent;
    function  GetLastErrorHtml: string;
    function  GetLastErrorText: string;
    function  GetLastErrorXml: string;
    function  GetVersion: string;
    function  GetDebugLogFilePath: string;
    procedure SetDebugLogFilePath(AValue: string);
    function  GetVerboseLogging: Boolean;
    procedure SetVerboseLogging(AValue: Boolean);
    function  GetLastMethodSuccess: Boolean;
    procedure SetLastMethodSuccess(AValue: Boolean);
    function  GetAuthorizationEndpoint: string;
    procedure SetAuthorizationEndpoint(AValue: string);
    function  GetTokenEndpoint: string;
    procedure SetTokenEndpoint(AValue: string);
    function  GetClientId: string;
    procedure SetClientId(AValue: string);
    function  GetClientSecret: string;
    procedure SetClientSecret(AValue: string);
    function  GetScope: string;
    procedure SetScope(AValue: string);
    function  GetCodeChallenge: Boolean;
    procedure SetCodeChallenge(AValue: Boolean);
    function  GetCodeChallengeMethod: string;
    procedure SetCodeChallengeMethod(AValue: string);
    function  GetAccessTokenResponse: string;
    function  GetAuthFlowState: Integer;
    function  GetFailureInfo: string;
    function  GetRedirectAllowHtml: string;
    procedure SetRedirectAllowHtml(AValue: string);
    function  GetRedirectDenyHtml: string;
    procedure SetRedirectDenyHtml(AValue: string);
    function  GetAccessToken: string;
    procedure SetAccessToken(AValue: string);
    function  GetTokenType: string;
    procedure SetTokenType(AValue: string);
    function  GetRefreshToken: string;
    procedure SetRefreshToken(AValue: string);
    function  GetListenPort: Integer;
    procedure SetListenPort(AValue: Integer);
    function  GetLocalHost: string;
    procedure SetLocalHost(AValue: string);
    function  GetResource: string;
    procedure SetResource(AValue: string);
    function  GetListenPortRangeEnd: Integer;
    procedure SetListenPortRangeEnd(AValue: Integer);
    function  GetAppCallbackUrl: string;
    procedure SetAppCallbackUrl(AValue: string);
    function  GetUseBasicAuth: Boolean;
    procedure SetUseBasicAuth(AValue: Boolean);
    function  GetIncludeNonce: Boolean;
    procedure SetIncludeNonce(AValue: Boolean);
    function  GetResponseMode: string;
    procedure SetResponseMode(AValue: string);
    function  GetResponseType: string;
    procedure SetResponseType(AValue: string);
    function  GetNonceLength: Integer;
    procedure SetNonceLength(AValue: Integer);
    function  GetUncommonOptions: string;
    procedure SetUncommonOptions(AValue: string);
    function  GetRedirectReqReceived: string;
    function  GetStateParam: string;
    procedure SetStateParam(AValue: string);
    function  GetListenPortSelected: Integer;
    function  GetOob: Boolean;
    procedure SetOob(AValue: Boolean);
    function  GetEnableSecrets: Boolean;
    procedure SetEnableSecrets(AValue: Boolean);
    procedure SetOnAbortCheck(AValue: TChilkatAbortCheckEvent);
    procedure SetOnPercentDone(AValue: TChilkatPercentDoneEvent);
    procedure SetOnProgressInfo(AValue: TChilkatProgressInfoEvent);
  public
    constructor Create;
    destructor  Destroy; override;

    property LastErrorHtml: string read GetLastErrorHtml;
    property LastErrorText: string read GetLastErrorText;
    property LastErrorXml: string read GetLastErrorXml;
    property Version: string read GetVersion;
    property DebugLogFilePath: string read GetDebugLogFilePath write SetDebugLogFilePath;
    property VerboseLogging: Boolean read GetVerboseLogging write SetVerboseLogging;
    property LastMethodSuccess: Boolean read GetLastMethodSuccess write SetLastMethodSuccess;
    property AuthorizationEndpoint: string read GetAuthorizationEndpoint write SetAuthorizationEndpoint;
    property TokenEndpoint: string read GetTokenEndpoint write SetTokenEndpoint;
    property ClientId: string read GetClientId write SetClientId;
    property ClientSecret: string read GetClientSecret write SetClientSecret;
    property Scope: string read GetScope write SetScope;
    property CodeChallenge: Boolean read GetCodeChallenge write SetCodeChallenge;
    property CodeChallengeMethod: string read GetCodeChallengeMethod write SetCodeChallengeMethod;
    property AccessTokenResponse: string read GetAccessTokenResponse;
    property AuthFlowState: Integer read GetAuthFlowState;
    property FailureInfo: string read GetFailureInfo;
    property RedirectAllowHtml: string read GetRedirectAllowHtml write SetRedirectAllowHtml;
    property RedirectDenyHtml: string read GetRedirectDenyHtml write SetRedirectDenyHtml;
    property AccessToken: string read GetAccessToken write SetAccessToken;
    property TokenType: string read GetTokenType write SetTokenType;
    property RefreshToken: string read GetRefreshToken write SetRefreshToken;
    property ListenPort: Integer read GetListenPort write SetListenPort;
    property LocalHost: string read GetLocalHost write SetLocalHost;
    property Resource: string read GetResource write SetResource;
    property ListenPortRangeEnd: Integer read GetListenPortRangeEnd write SetListenPortRangeEnd;
    property AppCallbackUrl: string read GetAppCallbackUrl write SetAppCallbackUrl;
    property UseBasicAuth: Boolean read GetUseBasicAuth write SetUseBasicAuth;
    property IncludeNonce: Boolean read GetIncludeNonce write SetIncludeNonce;
    property ResponseMode: string read GetResponseMode write SetResponseMode;
    property ResponseType: string read GetResponseType write SetResponseType;
    property NonceLength: Integer read GetNonceLength write SetNonceLength;
    property UncommonOptions: string read GetUncommonOptions write SetUncommonOptions;
    property RedirectReqReceived: string read GetRedirectReqReceived;
    property StateParam: string read GetStateParam write SetStateParam;
    property ListenPortSelected: Integer read GetListenPortSelected;
    property Oob: Boolean read GetOob write SetOob;
    property EnableSecrets: Boolean read GetEnableSecrets write SetEnableSecrets;

    { Event callbacks.  Return True from OnAbortCheck / OnPercentDone
      to abort the running method.  Callbacks are invoked on the
      thread that called the Chilkat method.  The HeartbeatMs
      property controls the AbortCheck frequency. }
    property OnAbortCheck: TChilkatAbortCheckEvent read FOnAbortCheck write SetOnAbortCheck;
    property OnPercentDone: TChilkatPercentDoneEvent read FOnPercentDone write SetOnPercentDone;
    property OnProgressInfo: TChilkatProgressInfoEvent read FOnProgressInfo write SetOnProgressInfo;

    function  StartAuth: string;
    function  Cancel: Boolean;
    procedure SleepMs(millisec: Integer);
    function  RefreshAccessToken: Boolean;
    function  UseConnection(sock: TChilkatBase): Boolean;
    function  GetRedirectRequestParam(const paramName: string): string;
    function  SetRefreshHeader(const name: string; const value: string): Boolean;
    function  AddTokenQueryParam(const name: string; const value: string): Boolean;
    function  AddAuthQueryParam(const name: string; const value: string): Boolean;
    function  AddRefreshQueryParam(const name: string; const value: string): Boolean;
    function  LaunchBrowser(const url: string): Boolean;
    function  ExchangeCodeForToken(const code: string): Boolean;
    function  GetAccessTokenResponseSb(sb: TChilkatBase): Boolean;
  end;

implementation

uses
  CkDllLoader,
  Chilkat.Utils;

{ ---- C bridge function pointer types ---- }
type
  TCkOAuth2_Create  = function(): Pointer; cdecl;
  TCkOAuth2_Dispose = procedure(handle: Pointer); cdecl;
  TCkBridgeAbortCheckCb   = function(userData: Pointer): Integer; cdecl;
  TCkBridgePercentDoneCb  = function(pctDone: Integer; userData: Pointer): Integer; cdecl;
  TCkBridgeProgressInfoCb = procedure(name: PAnsiChar; value: PAnsiChar; userData: Pointer); cdecl;
  TCkOAuth2_SetAbortCheckCallback   = procedure(handle: Pointer; cb: TCkBridgeAbortCheckCb; userData: Pointer); cdecl;
  TCkOAuth2_SetPercentDoneCallback  = procedure(handle: Pointer; cb: TCkBridgePercentDoneCb; userData: Pointer); cdecl;
  TCkOAuth2_SetProgressInfoCallback = procedure(handle: Pointer; cb: TCkBridgeProgressInfoCb; userData: Pointer); cdecl;
  TCkOAuth2_get_LastErrorHtml = function(handle: Pointer): PAnsiChar; cdecl;
  TCkOAuth2_get_LastErrorText = function(handle: Pointer): PAnsiChar; cdecl;
  TCkOAuth2_get_LastErrorXml = function(handle: Pointer): PAnsiChar; cdecl;
  TCkOAuth2_get_Version = function(handle: Pointer): PAnsiChar; cdecl;
  TCkOAuth2_get_DebugLogFilePath = function(handle: Pointer): PAnsiChar; cdecl;
  TCkOAuth2_put_DebugLogFilePath = procedure(handle: Pointer; value: PAnsiChar); cdecl;
  TCkOAuth2_get_VerboseLogging = function(handle: Pointer): LongBool; cdecl;
  TCkOAuth2_put_VerboseLogging = procedure(handle: Pointer; value: LongBool); cdecl;
  TCkOAuth2_get_LastMethodSuccess = function(handle: Pointer): LongBool; cdecl;
  TCkOAuth2_put_LastMethodSuccess = procedure(handle: Pointer; value: LongBool); cdecl;
  TCkOAuth2_get_AuthorizationEndpoint = function(handle: Pointer): PAnsiChar; cdecl;
  TCkOAuth2_put_AuthorizationEndpoint = procedure(handle: Pointer; value: PAnsiChar); cdecl;
  TCkOAuth2_get_TokenEndpoint = function(handle: Pointer): PAnsiChar; cdecl;
  TCkOAuth2_put_TokenEndpoint = procedure(handle: Pointer; value: PAnsiChar); cdecl;
  TCkOAuth2_get_ClientId = function(handle: Pointer): PAnsiChar; cdecl;
  TCkOAuth2_put_ClientId = procedure(handle: Pointer; value: PAnsiChar); cdecl;
  TCkOAuth2_get_ClientSecret = function(handle: Pointer): PAnsiChar; cdecl;
  TCkOAuth2_put_ClientSecret = procedure(handle: Pointer; value: PAnsiChar); cdecl;
  TCkOAuth2_get_Scope = function(handle: Pointer): PAnsiChar; cdecl;
  TCkOAuth2_put_Scope = procedure(handle: Pointer; value: PAnsiChar); cdecl;
  TCkOAuth2_get_CodeChallenge = function(handle: Pointer): LongBool; cdecl;
  TCkOAuth2_put_CodeChallenge = procedure(handle: Pointer; value: LongBool); cdecl;
  TCkOAuth2_get_CodeChallengeMethod = function(handle: Pointer): PAnsiChar; cdecl;
  TCkOAuth2_put_CodeChallengeMethod = procedure(handle: Pointer; value: PAnsiChar); cdecl;
  TCkOAuth2_get_AccessTokenResponse = function(handle: Pointer): PAnsiChar; cdecl;
  TCkOAuth2_get_AuthFlowState = function(handle: Pointer): Integer; cdecl;
  TCkOAuth2_get_FailureInfo = function(handle: Pointer): PAnsiChar; cdecl;
  TCkOAuth2_get_RedirectAllowHtml = function(handle: Pointer): PAnsiChar; cdecl;
  TCkOAuth2_put_RedirectAllowHtml = procedure(handle: Pointer; value: PAnsiChar); cdecl;
  TCkOAuth2_get_RedirectDenyHtml = function(handle: Pointer): PAnsiChar; cdecl;
  TCkOAuth2_put_RedirectDenyHtml = procedure(handle: Pointer; value: PAnsiChar); cdecl;
  TCkOAuth2_get_AccessToken = function(handle: Pointer): PAnsiChar; cdecl;
  TCkOAuth2_put_AccessToken = procedure(handle: Pointer; value: PAnsiChar); cdecl;
  TCkOAuth2_get_TokenType = function(handle: Pointer): PAnsiChar; cdecl;
  TCkOAuth2_put_TokenType = procedure(handle: Pointer; value: PAnsiChar); cdecl;
  TCkOAuth2_get_RefreshToken = function(handle: Pointer): PAnsiChar; cdecl;
  TCkOAuth2_put_RefreshToken = procedure(handle: Pointer; value: PAnsiChar); cdecl;
  TCkOAuth2_get_ListenPort = function(handle: Pointer): Integer; cdecl;
  TCkOAuth2_put_ListenPort = procedure(handle: Pointer; value: Integer); cdecl;
  TCkOAuth2_get_LocalHost = function(handle: Pointer): PAnsiChar; cdecl;
  TCkOAuth2_put_LocalHost = procedure(handle: Pointer; value: PAnsiChar); cdecl;
  TCkOAuth2_get_Resource = function(handle: Pointer): PAnsiChar; cdecl;
  TCkOAuth2_put_Resource = procedure(handle: Pointer; value: PAnsiChar); cdecl;
  TCkOAuth2_get_ListenPortRangeEnd = function(handle: Pointer): Integer; cdecl;
  TCkOAuth2_put_ListenPortRangeEnd = procedure(handle: Pointer; value: Integer); cdecl;
  TCkOAuth2_get_AppCallbackUrl = function(handle: Pointer): PAnsiChar; cdecl;
  TCkOAuth2_put_AppCallbackUrl = procedure(handle: Pointer; value: PAnsiChar); cdecl;
  TCkOAuth2_get_UseBasicAuth = function(handle: Pointer): LongBool; cdecl;
  TCkOAuth2_put_UseBasicAuth = procedure(handle: Pointer; value: LongBool); cdecl;
  TCkOAuth2_get_IncludeNonce = function(handle: Pointer): LongBool; cdecl;
  TCkOAuth2_put_IncludeNonce = procedure(handle: Pointer; value: LongBool); cdecl;
  TCkOAuth2_get_ResponseMode = function(handle: Pointer): PAnsiChar; cdecl;
  TCkOAuth2_put_ResponseMode = procedure(handle: Pointer; value: PAnsiChar); cdecl;
  TCkOAuth2_get_ResponseType = function(handle: Pointer): PAnsiChar; cdecl;
  TCkOAuth2_put_ResponseType = procedure(handle: Pointer; value: PAnsiChar); cdecl;
  TCkOAuth2_get_NonceLength = function(handle: Pointer): Integer; cdecl;
  TCkOAuth2_put_NonceLength = procedure(handle: Pointer; value: Integer); cdecl;
  TCkOAuth2_get_UncommonOptions = function(handle: Pointer): PAnsiChar; cdecl;
  TCkOAuth2_put_UncommonOptions = procedure(handle: Pointer; value: PAnsiChar); cdecl;
  TCkOAuth2_get_RedirectReqReceived = function(handle: Pointer): PAnsiChar; cdecl;
  TCkOAuth2_get_StateParam = function(handle: Pointer): PAnsiChar; cdecl;
  TCkOAuth2_put_StateParam = procedure(handle: Pointer; value: PAnsiChar); cdecl;
  TCkOAuth2_get_ListenPortSelected = function(handle: Pointer): Integer; cdecl;
  TCkOAuth2_get_Oob = function(handle: Pointer): LongBool; cdecl;
  TCkOAuth2_put_Oob = procedure(handle: Pointer; value: LongBool); cdecl;
  TCkOAuth2_get_EnableSecrets = function(handle: Pointer): LongBool; cdecl;
  TCkOAuth2_put_EnableSecrets = procedure(handle: Pointer; value: LongBool); cdecl;
  TCkOAuth2_StartAuth = function(handle: Pointer): PAnsiChar; cdecl;
  TCkOAuth2_Cancel = function(handle: Pointer): LongBool; cdecl;
  TCkOAuth2_SleepMs = procedure(handle: Pointer; millisec: Integer); cdecl;
  TCkOAuth2_RefreshAccessToken = function(handle: Pointer): LongBool; cdecl;
  TCkOAuth2_UseConnection = function(handle: Pointer; sock: Pointer): LongBool; cdecl;
  TCkOAuth2_GetRedirectRequestParam = function(handle: Pointer; paramName: PAnsiChar): PAnsiChar; cdecl;
  TCkOAuth2_SetRefreshHeader = function(handle: Pointer; name: PAnsiChar; value: PAnsiChar): LongBool; cdecl;
  TCkOAuth2_AddTokenQueryParam = function(handle: Pointer; name: PAnsiChar; value: PAnsiChar): LongBool; cdecl;
  TCkOAuth2_AddAuthQueryParam = function(handle: Pointer; name: PAnsiChar; value: PAnsiChar): LongBool; cdecl;
  TCkOAuth2_AddRefreshQueryParam = function(handle: Pointer; name: PAnsiChar; value: PAnsiChar): LongBool; cdecl;
  TCkOAuth2_LaunchBrowser = function(handle: Pointer; url: PAnsiChar): LongBool; cdecl;
  TCkOAuth2_ExchangeCodeForToken = function(handle: Pointer; code: PAnsiChar): LongBool; cdecl;
  TCkOAuth2_GetAccessTokenResponseSb = function(handle: Pointer; sb: Pointer): LongBool; cdecl;

{ ---- C bridge function pointer variables ---- }
var
  CkOAuth2_Create:  TCkOAuth2_Create  = nil;
  CkOAuth2_Dispose: TCkOAuth2_Dispose = nil;
  CkOAuth2_SetAbortCheckCallback:   TCkOAuth2_SetAbortCheckCallback   = nil;
  CkOAuth2_SetPercentDoneCallback:  TCkOAuth2_SetPercentDoneCallback  = nil;
  CkOAuth2_SetProgressInfoCallback: TCkOAuth2_SetProgressInfoCallback = nil;
  CkOAuth2_get_LastErrorHtml: TCkOAuth2_get_LastErrorHtml = nil;
  CkOAuth2_get_LastErrorText: TCkOAuth2_get_LastErrorText = nil;
  CkOAuth2_get_LastErrorXml: TCkOAuth2_get_LastErrorXml = nil;
  CkOAuth2_get_Version: TCkOAuth2_get_Version = nil;
  CkOAuth2_get_DebugLogFilePath: TCkOAuth2_get_DebugLogFilePath = nil;
  CkOAuth2_put_DebugLogFilePath: TCkOAuth2_put_DebugLogFilePath = nil;
  CkOAuth2_get_VerboseLogging: TCkOAuth2_get_VerboseLogging = nil;
  CkOAuth2_put_VerboseLogging: TCkOAuth2_put_VerboseLogging = nil;
  CkOAuth2_get_LastMethodSuccess: TCkOAuth2_get_LastMethodSuccess = nil;
  CkOAuth2_put_LastMethodSuccess: TCkOAuth2_put_LastMethodSuccess = nil;
  CkOAuth2_get_AuthorizationEndpoint: TCkOAuth2_get_AuthorizationEndpoint = nil;
  CkOAuth2_put_AuthorizationEndpoint: TCkOAuth2_put_AuthorizationEndpoint = nil;
  CkOAuth2_get_TokenEndpoint: TCkOAuth2_get_TokenEndpoint = nil;
  CkOAuth2_put_TokenEndpoint: TCkOAuth2_put_TokenEndpoint = nil;
  CkOAuth2_get_ClientId: TCkOAuth2_get_ClientId = nil;
  CkOAuth2_put_ClientId: TCkOAuth2_put_ClientId = nil;
  CkOAuth2_get_ClientSecret: TCkOAuth2_get_ClientSecret = nil;
  CkOAuth2_put_ClientSecret: TCkOAuth2_put_ClientSecret = nil;
  CkOAuth2_get_Scope: TCkOAuth2_get_Scope = nil;
  CkOAuth2_put_Scope: TCkOAuth2_put_Scope = nil;
  CkOAuth2_get_CodeChallenge: TCkOAuth2_get_CodeChallenge = nil;
  CkOAuth2_put_CodeChallenge: TCkOAuth2_put_CodeChallenge = nil;
  CkOAuth2_get_CodeChallengeMethod: TCkOAuth2_get_CodeChallengeMethod = nil;
  CkOAuth2_put_CodeChallengeMethod: TCkOAuth2_put_CodeChallengeMethod = nil;
  CkOAuth2_get_AccessTokenResponse: TCkOAuth2_get_AccessTokenResponse = nil;
  CkOAuth2_get_AuthFlowState: TCkOAuth2_get_AuthFlowState = nil;
  CkOAuth2_get_FailureInfo: TCkOAuth2_get_FailureInfo = nil;
  CkOAuth2_get_RedirectAllowHtml: TCkOAuth2_get_RedirectAllowHtml = nil;
  CkOAuth2_put_RedirectAllowHtml: TCkOAuth2_put_RedirectAllowHtml = nil;
  CkOAuth2_get_RedirectDenyHtml: TCkOAuth2_get_RedirectDenyHtml = nil;
  CkOAuth2_put_RedirectDenyHtml: TCkOAuth2_put_RedirectDenyHtml = nil;
  CkOAuth2_get_AccessToken: TCkOAuth2_get_AccessToken = nil;
  CkOAuth2_put_AccessToken: TCkOAuth2_put_AccessToken = nil;
  CkOAuth2_get_TokenType: TCkOAuth2_get_TokenType = nil;
  CkOAuth2_put_TokenType: TCkOAuth2_put_TokenType = nil;
  CkOAuth2_get_RefreshToken: TCkOAuth2_get_RefreshToken = nil;
  CkOAuth2_put_RefreshToken: TCkOAuth2_put_RefreshToken = nil;
  CkOAuth2_get_ListenPort: TCkOAuth2_get_ListenPort = nil;
  CkOAuth2_put_ListenPort: TCkOAuth2_put_ListenPort = nil;
  CkOAuth2_get_LocalHost: TCkOAuth2_get_LocalHost = nil;
  CkOAuth2_put_LocalHost: TCkOAuth2_put_LocalHost = nil;
  CkOAuth2_get_Resource: TCkOAuth2_get_Resource = nil;
  CkOAuth2_put_Resource: TCkOAuth2_put_Resource = nil;
  CkOAuth2_get_ListenPortRangeEnd: TCkOAuth2_get_ListenPortRangeEnd = nil;
  CkOAuth2_put_ListenPortRangeEnd: TCkOAuth2_put_ListenPortRangeEnd = nil;
  CkOAuth2_get_AppCallbackUrl: TCkOAuth2_get_AppCallbackUrl = nil;
  CkOAuth2_put_AppCallbackUrl: TCkOAuth2_put_AppCallbackUrl = nil;
  CkOAuth2_get_UseBasicAuth: TCkOAuth2_get_UseBasicAuth = nil;
  CkOAuth2_put_UseBasicAuth: TCkOAuth2_put_UseBasicAuth = nil;
  CkOAuth2_get_IncludeNonce: TCkOAuth2_get_IncludeNonce = nil;
  CkOAuth2_put_IncludeNonce: TCkOAuth2_put_IncludeNonce = nil;
  CkOAuth2_get_ResponseMode: TCkOAuth2_get_ResponseMode = nil;
  CkOAuth2_put_ResponseMode: TCkOAuth2_put_ResponseMode = nil;
  CkOAuth2_get_ResponseType: TCkOAuth2_get_ResponseType = nil;
  CkOAuth2_put_ResponseType: TCkOAuth2_put_ResponseType = nil;
  CkOAuth2_get_NonceLength: TCkOAuth2_get_NonceLength = nil;
  CkOAuth2_put_NonceLength: TCkOAuth2_put_NonceLength = nil;
  CkOAuth2_get_UncommonOptions: TCkOAuth2_get_UncommonOptions = nil;
  CkOAuth2_put_UncommonOptions: TCkOAuth2_put_UncommonOptions = nil;
  CkOAuth2_get_RedirectReqReceived: TCkOAuth2_get_RedirectReqReceived = nil;
  CkOAuth2_get_StateParam: TCkOAuth2_get_StateParam = nil;
  CkOAuth2_put_StateParam: TCkOAuth2_put_StateParam = nil;
  CkOAuth2_get_ListenPortSelected: TCkOAuth2_get_ListenPortSelected = nil;
  CkOAuth2_get_Oob: TCkOAuth2_get_Oob = nil;
  CkOAuth2_put_Oob: TCkOAuth2_put_Oob = nil;
  CkOAuth2_get_EnableSecrets: TCkOAuth2_get_EnableSecrets = nil;
  CkOAuth2_put_EnableSecrets: TCkOAuth2_put_EnableSecrets = nil;
  CkOAuth2_StartAuth: TCkOAuth2_StartAuth = nil;
  CkOAuth2_Cancel: TCkOAuth2_Cancel = nil;
  CkOAuth2_SleepMs: TCkOAuth2_SleepMs = nil;
  CkOAuth2_RefreshAccessToken: TCkOAuth2_RefreshAccessToken = nil;
  CkOAuth2_UseConnection: TCkOAuth2_UseConnection = nil;
  CkOAuth2_GetRedirectRequestParam: TCkOAuth2_GetRedirectRequestParam = nil;
  CkOAuth2_SetRefreshHeader: TCkOAuth2_SetRefreshHeader = nil;
  CkOAuth2_AddTokenQueryParam: TCkOAuth2_AddTokenQueryParam = nil;
  CkOAuth2_AddAuthQueryParam: TCkOAuth2_AddAuthQueryParam = nil;
  CkOAuth2_AddRefreshQueryParam: TCkOAuth2_AddRefreshQueryParam = nil;
  CkOAuth2_LaunchBrowser: TCkOAuth2_LaunchBrowser = nil;
  CkOAuth2_ExchangeCodeForToken: TCkOAuth2_ExchangeCodeForToken = nil;
  CkOAuth2_GetAccessTokenResponseSb: TCkOAuth2_GetAccessTokenResponseSb = nil;

constructor TOAuth2.Create;
begin
  inherited Create;
  FHandle := CkOAuth2_Create();
end;

destructor TOAuth2.Destroy;
begin
  if FHandle <> nil then
    CkOAuth2_Dispose(FHandle);
  FHandle := nil;
  inherited;
end;

{ ---- Event callback thunks ---- }
{ Standalone cdecl functions registered with the C bridge.  The bridge
  passes back the userData pointer, which carries the Pascal object
  instance.  A non-zero return value aborts the running method. }

function TOAuth2_AbortCheckThunk(userData: Pointer): Integer; cdecl;
var
  obj: TOAuth2;
begin
  Result := 0;
  obj := TOAuth2(userData);
  if Assigned(obj) and Assigned(obj.FOnAbortCheck) then
    if obj.FOnAbortCheck(obj) then Result := 1;
end;

function TOAuth2_PercentDoneThunk(pctDone: Integer; userData: Pointer): Integer; cdecl;
var
  obj: TOAuth2;
begin
  Result := 0;
  obj := TOAuth2(userData);
  if Assigned(obj) and Assigned(obj.FOnPercentDone) then
    if obj.FOnPercentDone(obj, pctDone) then Result := 1;
end;

procedure TOAuth2_ProgressInfoThunk(name: PAnsiChar; value: PAnsiChar; userData: Pointer); cdecl;
var
  obj: TOAuth2;
begin
  obj := TOAuth2(userData);
  if Assigned(obj) and Assigned(obj.FOnProgressInfo) then
    obj.FOnProgressInfo(obj, CkToStr(name), CkToStr(value));
end;

procedure TOAuth2.SetOnAbortCheck(AValue: TChilkatAbortCheckEvent);
begin
  FOnAbortCheck := AValue;
  if Assigned(AValue) then
    CkOAuth2_SetAbortCheckCallback(FHandle, @TOAuth2_AbortCheckThunk, Self)
  else
    CkOAuth2_SetAbortCheckCallback(FHandle, nil, nil);
end;

procedure TOAuth2.SetOnPercentDone(AValue: TChilkatPercentDoneEvent);
begin
  FOnPercentDone := AValue;
  if Assigned(AValue) then
    CkOAuth2_SetPercentDoneCallback(FHandle, @TOAuth2_PercentDoneThunk, Self)
  else
    CkOAuth2_SetPercentDoneCallback(FHandle, nil, nil);
end;

procedure TOAuth2.SetOnProgressInfo(AValue: TChilkatProgressInfoEvent);
begin
  FOnProgressInfo := AValue;
  if Assigned(AValue) then
    CkOAuth2_SetProgressInfoCallback(FHandle, @TOAuth2_ProgressInfoThunk, Self)
  else
    CkOAuth2_SetProgressInfoCallback(FHandle, nil, nil);
end;

function TOAuth2.GetLastErrorHtml: string;
begin
  Result := CkToStr(CkOAuth2_get_LastErrorHtml(FHandle));
end;

function TOAuth2.GetLastErrorText: string;
begin
  Result := CkToStr(CkOAuth2_get_LastErrorText(FHandle));
end;

function TOAuth2.GetLastErrorXml: string;
begin
  Result := CkToStr(CkOAuth2_get_LastErrorXml(FHandle));
end;

function TOAuth2.GetVersion: string;
begin
  Result := CkToStr(CkOAuth2_get_Version(FHandle));
end;

function TOAuth2.GetDebugLogFilePath: string;
begin
  Result := CkToStr(CkOAuth2_get_DebugLogFilePath(FHandle));
end;

procedure TOAuth2.SetDebugLogFilePath(AValue: string);
begin
  CkOAuth2_put_DebugLogFilePath(FHandle, PAnsiChar(StrToCk(AValue)));
end;

function TOAuth2.GetVerboseLogging: Boolean;
begin
  Result := Boolean(CkOAuth2_get_VerboseLogging(FHandle));
end;

procedure TOAuth2.SetVerboseLogging(AValue: Boolean);
begin
  CkOAuth2_put_VerboseLogging(FHandle, LongBool(AValue));
end;

function TOAuth2.GetLastMethodSuccess: Boolean;
begin
  Result := Boolean(CkOAuth2_get_LastMethodSuccess(FHandle));
end;

procedure TOAuth2.SetLastMethodSuccess(AValue: Boolean);
begin
  CkOAuth2_put_LastMethodSuccess(FHandle, LongBool(AValue));
end;

function TOAuth2.GetAuthorizationEndpoint: string;
begin
  Result := CkToStr(CkOAuth2_get_AuthorizationEndpoint(FHandle));
end;

procedure TOAuth2.SetAuthorizationEndpoint(AValue: string);
begin
  CkOAuth2_put_AuthorizationEndpoint(FHandle, PAnsiChar(StrToCk(AValue)));
end;

function TOAuth2.GetTokenEndpoint: string;
begin
  Result := CkToStr(CkOAuth2_get_TokenEndpoint(FHandle));
end;

procedure TOAuth2.SetTokenEndpoint(AValue: string);
begin
  CkOAuth2_put_TokenEndpoint(FHandle, PAnsiChar(StrToCk(AValue)));
end;

function TOAuth2.GetClientId: string;
begin
  Result := CkToStr(CkOAuth2_get_ClientId(FHandle));
end;

procedure TOAuth2.SetClientId(AValue: string);
begin
  CkOAuth2_put_ClientId(FHandle, PAnsiChar(StrToCk(AValue)));
end;

function TOAuth2.GetClientSecret: string;
begin
  Result := CkToStr(CkOAuth2_get_ClientSecret(FHandle));
end;

procedure TOAuth2.SetClientSecret(AValue: string);
begin
  CkOAuth2_put_ClientSecret(FHandle, PAnsiChar(StrToCk(AValue)));
end;

function TOAuth2.GetScope: string;
begin
  Result := CkToStr(CkOAuth2_get_Scope(FHandle));
end;

procedure TOAuth2.SetScope(AValue: string);
begin
  CkOAuth2_put_Scope(FHandle, PAnsiChar(StrToCk(AValue)));
end;

function TOAuth2.GetCodeChallenge: Boolean;
begin
  Result := Boolean(CkOAuth2_get_CodeChallenge(FHandle));
end;

procedure TOAuth2.SetCodeChallenge(AValue: Boolean);
begin
  CkOAuth2_put_CodeChallenge(FHandle, LongBool(AValue));
end;

function TOAuth2.GetCodeChallengeMethod: string;
begin
  Result := CkToStr(CkOAuth2_get_CodeChallengeMethod(FHandle));
end;

procedure TOAuth2.SetCodeChallengeMethod(AValue: string);
begin
  CkOAuth2_put_CodeChallengeMethod(FHandle, PAnsiChar(StrToCk(AValue)));
end;

function TOAuth2.GetAccessTokenResponse: string;
begin
  Result := CkToStr(CkOAuth2_get_AccessTokenResponse(FHandle));
end;

function TOAuth2.GetAuthFlowState: Integer;
begin
  Result := CkOAuth2_get_AuthFlowState(FHandle);
end;

function TOAuth2.GetFailureInfo: string;
begin
  Result := CkToStr(CkOAuth2_get_FailureInfo(FHandle));
end;

function TOAuth2.GetRedirectAllowHtml: string;
begin
  Result := CkToStr(CkOAuth2_get_RedirectAllowHtml(FHandle));
end;

procedure TOAuth2.SetRedirectAllowHtml(AValue: string);
begin
  CkOAuth2_put_RedirectAllowHtml(FHandle, PAnsiChar(StrToCk(AValue)));
end;

function TOAuth2.GetRedirectDenyHtml: string;
begin
  Result := CkToStr(CkOAuth2_get_RedirectDenyHtml(FHandle));
end;

procedure TOAuth2.SetRedirectDenyHtml(AValue: string);
begin
  CkOAuth2_put_RedirectDenyHtml(FHandle, PAnsiChar(StrToCk(AValue)));
end;

function TOAuth2.GetAccessToken: string;
begin
  Result := CkToStr(CkOAuth2_get_AccessToken(FHandle));
end;

procedure TOAuth2.SetAccessToken(AValue: string);
begin
  CkOAuth2_put_AccessToken(FHandle, PAnsiChar(StrToCk(AValue)));
end;

function TOAuth2.GetTokenType: string;
begin
  Result := CkToStr(CkOAuth2_get_TokenType(FHandle));
end;

procedure TOAuth2.SetTokenType(AValue: string);
begin
  CkOAuth2_put_TokenType(FHandle, PAnsiChar(StrToCk(AValue)));
end;

function TOAuth2.GetRefreshToken: string;
begin
  Result := CkToStr(CkOAuth2_get_RefreshToken(FHandle));
end;

procedure TOAuth2.SetRefreshToken(AValue: string);
begin
  CkOAuth2_put_RefreshToken(FHandle, PAnsiChar(StrToCk(AValue)));
end;

function TOAuth2.GetListenPort: Integer;
begin
  Result := CkOAuth2_get_ListenPort(FHandle);
end;

procedure TOAuth2.SetListenPort(AValue: Integer);
begin
  CkOAuth2_put_ListenPort(FHandle, AValue);
end;

function TOAuth2.GetLocalHost: string;
begin
  Result := CkToStr(CkOAuth2_get_LocalHost(FHandle));
end;

procedure TOAuth2.SetLocalHost(AValue: string);
begin
  CkOAuth2_put_LocalHost(FHandle, PAnsiChar(StrToCk(AValue)));
end;

function TOAuth2.GetResource: string;
begin
  Result := CkToStr(CkOAuth2_get_Resource(FHandle));
end;

procedure TOAuth2.SetResource(AValue: string);
begin
  CkOAuth2_put_Resource(FHandle, PAnsiChar(StrToCk(AValue)));
end;

function TOAuth2.GetListenPortRangeEnd: Integer;
begin
  Result := CkOAuth2_get_ListenPortRangeEnd(FHandle);
end;

procedure TOAuth2.SetListenPortRangeEnd(AValue: Integer);
begin
  CkOAuth2_put_ListenPortRangeEnd(FHandle, AValue);
end;

function TOAuth2.GetAppCallbackUrl: string;
begin
  Result := CkToStr(CkOAuth2_get_AppCallbackUrl(FHandle));
end;

procedure TOAuth2.SetAppCallbackUrl(AValue: string);
begin
  CkOAuth2_put_AppCallbackUrl(FHandle, PAnsiChar(StrToCk(AValue)));
end;

function TOAuth2.GetUseBasicAuth: Boolean;
begin
  Result := Boolean(CkOAuth2_get_UseBasicAuth(FHandle));
end;

procedure TOAuth2.SetUseBasicAuth(AValue: Boolean);
begin
  CkOAuth2_put_UseBasicAuth(FHandle, LongBool(AValue));
end;

function TOAuth2.GetIncludeNonce: Boolean;
begin
  Result := Boolean(CkOAuth2_get_IncludeNonce(FHandle));
end;

procedure TOAuth2.SetIncludeNonce(AValue: Boolean);
begin
  CkOAuth2_put_IncludeNonce(FHandle, LongBool(AValue));
end;

function TOAuth2.GetResponseMode: string;
begin
  Result := CkToStr(CkOAuth2_get_ResponseMode(FHandle));
end;

procedure TOAuth2.SetResponseMode(AValue: string);
begin
  CkOAuth2_put_ResponseMode(FHandle, PAnsiChar(StrToCk(AValue)));
end;

function TOAuth2.GetResponseType: string;
begin
  Result := CkToStr(CkOAuth2_get_ResponseType(FHandle));
end;

procedure TOAuth2.SetResponseType(AValue: string);
begin
  CkOAuth2_put_ResponseType(FHandle, PAnsiChar(StrToCk(AValue)));
end;

function TOAuth2.GetNonceLength: Integer;
begin
  Result := CkOAuth2_get_NonceLength(FHandle);
end;

procedure TOAuth2.SetNonceLength(AValue: Integer);
begin
  CkOAuth2_put_NonceLength(FHandle, AValue);
end;

function TOAuth2.GetUncommonOptions: string;
begin
  Result := CkToStr(CkOAuth2_get_UncommonOptions(FHandle));
end;

procedure TOAuth2.SetUncommonOptions(AValue: string);
begin
  CkOAuth2_put_UncommonOptions(FHandle, PAnsiChar(StrToCk(AValue)));
end;

function TOAuth2.GetRedirectReqReceived: string;
begin
  Result := CkToStr(CkOAuth2_get_RedirectReqReceived(FHandle));
end;

function TOAuth2.GetStateParam: string;
begin
  Result := CkToStr(CkOAuth2_get_StateParam(FHandle));
end;

procedure TOAuth2.SetStateParam(AValue: string);
begin
  CkOAuth2_put_StateParam(FHandle, PAnsiChar(StrToCk(AValue)));
end;

function TOAuth2.GetListenPortSelected: Integer;
begin
  Result := CkOAuth2_get_ListenPortSelected(FHandle);
end;

function TOAuth2.GetOob: Boolean;
begin
  Result := Boolean(CkOAuth2_get_Oob(FHandle));
end;

procedure TOAuth2.SetOob(AValue: Boolean);
begin
  CkOAuth2_put_Oob(FHandle, LongBool(AValue));
end;

function TOAuth2.GetEnableSecrets: Boolean;
begin
  Result := Boolean(CkOAuth2_get_EnableSecrets(FHandle));
end;

procedure TOAuth2.SetEnableSecrets(AValue: Boolean);
begin
  CkOAuth2_put_EnableSecrets(FHandle, LongBool(AValue));
end;

function TOAuth2.StartAuth: string;
begin
  Result := CkToStr(CkOAuth2_StartAuth(FHandle));
end;

function TOAuth2.Cancel: Boolean;
begin
  Result := Boolean(CkOAuth2_Cancel(FHandle));
end;

procedure TOAuth2.SleepMs(millisec: Integer);
begin
  CkOAuth2_SleepMs(FHandle, millisec);
end;

function TOAuth2.RefreshAccessToken: Boolean;
begin
  Result := Boolean(CkOAuth2_RefreshAccessToken(FHandle));
end;

function TOAuth2.UseConnection(sock: TChilkatBase): Boolean;
begin
  Result := Boolean(CkOAuth2_UseConnection(FHandle, sock.Handle));
end;

function TOAuth2.GetRedirectRequestParam(const paramName: string): string;
begin
  Result := CkToStr(CkOAuth2_GetRedirectRequestParam(FHandle, PAnsiChar(StrToCk(paramName))));
end;

function TOAuth2.SetRefreshHeader(const name: string; const value: string): Boolean;
begin
  Result := Boolean(CkOAuth2_SetRefreshHeader(FHandle, PAnsiChar(StrToCk(name)), PAnsiChar(StrToCk(value))));
end;

function TOAuth2.AddTokenQueryParam(const name: string; const value: string): Boolean;
begin
  Result := Boolean(CkOAuth2_AddTokenQueryParam(FHandle, PAnsiChar(StrToCk(name)), PAnsiChar(StrToCk(value))));
end;

function TOAuth2.AddAuthQueryParam(const name: string; const value: string): Boolean;
begin
  Result := Boolean(CkOAuth2_AddAuthQueryParam(FHandle, PAnsiChar(StrToCk(name)), PAnsiChar(StrToCk(value))));
end;

function TOAuth2.AddRefreshQueryParam(const name: string; const value: string): Boolean;
begin
  Result := Boolean(CkOAuth2_AddRefreshQueryParam(FHandle, PAnsiChar(StrToCk(name)), PAnsiChar(StrToCk(value))));
end;

function TOAuth2.LaunchBrowser(const url: string): Boolean;
begin
  Result := Boolean(CkOAuth2_LaunchBrowser(FHandle, PAnsiChar(StrToCk(url))));
end;

function TOAuth2.ExchangeCodeForToken(const code: string): Boolean;
begin
  Result := Boolean(CkOAuth2_ExchangeCodeForToken(FHandle, PAnsiChar(StrToCk(code))));
end;

function TOAuth2.GetAccessTokenResponseSb(sb: TChilkatBase): Boolean;
begin
  Result := Boolean(CkOAuth2_GetAccessTokenResponseSb(FHandle, sb.Handle));
end;

initialization
  Chilkat_GetProcedureAddress(CkOAuth2_Create,  'CkOAuth2_Create');
  Chilkat_GetProcedureAddress(CkOAuth2_Dispose, 'CkOAuth2_Dispose');
  Chilkat_GetProcedureAddress(CkOAuth2_SetAbortCheckCallback, 'CkOAuth2_SetAbortCheckCallback');
  Chilkat_GetProcedureAddress(CkOAuth2_SetPercentDoneCallback, 'CkOAuth2_SetPercentDoneCallback');
  Chilkat_GetProcedureAddress(CkOAuth2_SetProgressInfoCallback, 'CkOAuth2_SetProgressInfoCallback');
  Chilkat_GetProcedureAddress(CkOAuth2_get_LastErrorHtml, 'CkOAuth2_get_LastErrorHtml');
  Chilkat_GetProcedureAddress(CkOAuth2_get_LastErrorText, 'CkOAuth2_get_LastErrorText');
  Chilkat_GetProcedureAddress(CkOAuth2_get_LastErrorXml, 'CkOAuth2_get_LastErrorXml');
  Chilkat_GetProcedureAddress(CkOAuth2_get_Version, 'CkOAuth2_get_Version');
  Chilkat_GetProcedureAddress(CkOAuth2_get_DebugLogFilePath, 'CkOAuth2_get_DebugLogFilePath');
  Chilkat_GetProcedureAddress(CkOAuth2_put_DebugLogFilePath, 'CkOAuth2_put_DebugLogFilePath');
  Chilkat_GetProcedureAddress(CkOAuth2_get_VerboseLogging, 'CkOAuth2_get_VerboseLogging');
  Chilkat_GetProcedureAddress(CkOAuth2_put_VerboseLogging, 'CkOAuth2_put_VerboseLogging');
  Chilkat_GetProcedureAddress(CkOAuth2_get_LastMethodSuccess, 'CkOAuth2_get_LastMethodSuccess');
  Chilkat_GetProcedureAddress(CkOAuth2_put_LastMethodSuccess, 'CkOAuth2_put_LastMethodSuccess');
  Chilkat_GetProcedureAddress(CkOAuth2_get_AuthorizationEndpoint, 'CkOAuth2_get_AuthorizationEndpoint');
  Chilkat_GetProcedureAddress(CkOAuth2_put_AuthorizationEndpoint, 'CkOAuth2_put_AuthorizationEndpoint');
  Chilkat_GetProcedureAddress(CkOAuth2_get_TokenEndpoint, 'CkOAuth2_get_TokenEndpoint');
  Chilkat_GetProcedureAddress(CkOAuth2_put_TokenEndpoint, 'CkOAuth2_put_TokenEndpoint');
  Chilkat_GetProcedureAddress(CkOAuth2_get_ClientId, 'CkOAuth2_get_ClientId');
  Chilkat_GetProcedureAddress(CkOAuth2_put_ClientId, 'CkOAuth2_put_ClientId');
  Chilkat_GetProcedureAddress(CkOAuth2_get_ClientSecret, 'CkOAuth2_get_ClientSecret');
  Chilkat_GetProcedureAddress(CkOAuth2_put_ClientSecret, 'CkOAuth2_put_ClientSecret');
  Chilkat_GetProcedureAddress(CkOAuth2_get_Scope, 'CkOAuth2_get_Scope');
  Chilkat_GetProcedureAddress(CkOAuth2_put_Scope, 'CkOAuth2_put_Scope');
  Chilkat_GetProcedureAddress(CkOAuth2_get_CodeChallenge, 'CkOAuth2_get_CodeChallenge');
  Chilkat_GetProcedureAddress(CkOAuth2_put_CodeChallenge, 'CkOAuth2_put_CodeChallenge');
  Chilkat_GetProcedureAddress(CkOAuth2_get_CodeChallengeMethod, 'CkOAuth2_get_CodeChallengeMethod');
  Chilkat_GetProcedureAddress(CkOAuth2_put_CodeChallengeMethod, 'CkOAuth2_put_CodeChallengeMethod');
  Chilkat_GetProcedureAddress(CkOAuth2_get_AccessTokenResponse, 'CkOAuth2_get_AccessTokenResponse');
  Chilkat_GetProcedureAddress(CkOAuth2_get_AuthFlowState, 'CkOAuth2_get_AuthFlowState');
  Chilkat_GetProcedureAddress(CkOAuth2_get_FailureInfo, 'CkOAuth2_get_FailureInfo');
  Chilkat_GetProcedureAddress(CkOAuth2_get_RedirectAllowHtml, 'CkOAuth2_get_RedirectAllowHtml');
  Chilkat_GetProcedureAddress(CkOAuth2_put_RedirectAllowHtml, 'CkOAuth2_put_RedirectAllowHtml');
  Chilkat_GetProcedureAddress(CkOAuth2_get_RedirectDenyHtml, 'CkOAuth2_get_RedirectDenyHtml');
  Chilkat_GetProcedureAddress(CkOAuth2_put_RedirectDenyHtml, 'CkOAuth2_put_RedirectDenyHtml');
  Chilkat_GetProcedureAddress(CkOAuth2_get_AccessToken, 'CkOAuth2_get_AccessToken');
  Chilkat_GetProcedureAddress(CkOAuth2_put_AccessToken, 'CkOAuth2_put_AccessToken');
  Chilkat_GetProcedureAddress(CkOAuth2_get_TokenType, 'CkOAuth2_get_TokenType');
  Chilkat_GetProcedureAddress(CkOAuth2_put_TokenType, 'CkOAuth2_put_TokenType');
  Chilkat_GetProcedureAddress(CkOAuth2_get_RefreshToken, 'CkOAuth2_get_RefreshToken');
  Chilkat_GetProcedureAddress(CkOAuth2_put_RefreshToken, 'CkOAuth2_put_RefreshToken');
  Chilkat_GetProcedureAddress(CkOAuth2_get_ListenPort, 'CkOAuth2_get_ListenPort');
  Chilkat_GetProcedureAddress(CkOAuth2_put_ListenPort, 'CkOAuth2_put_ListenPort');
  Chilkat_GetProcedureAddress(CkOAuth2_get_LocalHost, 'CkOAuth2_get_LocalHost');
  Chilkat_GetProcedureAddress(CkOAuth2_put_LocalHost, 'CkOAuth2_put_LocalHost');
  Chilkat_GetProcedureAddress(CkOAuth2_get_Resource, 'CkOAuth2_get_Resource');
  Chilkat_GetProcedureAddress(CkOAuth2_put_Resource, 'CkOAuth2_put_Resource');
  Chilkat_GetProcedureAddress(CkOAuth2_get_ListenPortRangeEnd, 'CkOAuth2_get_ListenPortRangeEnd');
  Chilkat_GetProcedureAddress(CkOAuth2_put_ListenPortRangeEnd, 'CkOAuth2_put_ListenPortRangeEnd');
  Chilkat_GetProcedureAddress(CkOAuth2_get_AppCallbackUrl, 'CkOAuth2_get_AppCallbackUrl');
  Chilkat_GetProcedureAddress(CkOAuth2_put_AppCallbackUrl, 'CkOAuth2_put_AppCallbackUrl');
  Chilkat_GetProcedureAddress(CkOAuth2_get_UseBasicAuth, 'CkOAuth2_get_UseBasicAuth');
  Chilkat_GetProcedureAddress(CkOAuth2_put_UseBasicAuth, 'CkOAuth2_put_UseBasicAuth');
  Chilkat_GetProcedureAddress(CkOAuth2_get_IncludeNonce, 'CkOAuth2_get_IncludeNonce');
  Chilkat_GetProcedureAddress(CkOAuth2_put_IncludeNonce, 'CkOAuth2_put_IncludeNonce');
  Chilkat_GetProcedureAddress(CkOAuth2_get_ResponseMode, 'CkOAuth2_get_ResponseMode');
  Chilkat_GetProcedureAddress(CkOAuth2_put_ResponseMode, 'CkOAuth2_put_ResponseMode');
  Chilkat_GetProcedureAddress(CkOAuth2_get_ResponseType, 'CkOAuth2_get_ResponseType');
  Chilkat_GetProcedureAddress(CkOAuth2_put_ResponseType, 'CkOAuth2_put_ResponseType');
  Chilkat_GetProcedureAddress(CkOAuth2_get_NonceLength, 'CkOAuth2_get_NonceLength');
  Chilkat_GetProcedureAddress(CkOAuth2_put_NonceLength, 'CkOAuth2_put_NonceLength');
  Chilkat_GetProcedureAddress(CkOAuth2_get_UncommonOptions, 'CkOAuth2_get_UncommonOptions');
  Chilkat_GetProcedureAddress(CkOAuth2_put_UncommonOptions, 'CkOAuth2_put_UncommonOptions');
  Chilkat_GetProcedureAddress(CkOAuth2_get_RedirectReqReceived, 'CkOAuth2_get_RedirectReqReceived');
  Chilkat_GetProcedureAddress(CkOAuth2_get_StateParam, 'CkOAuth2_get_StateParam');
  Chilkat_GetProcedureAddress(CkOAuth2_put_StateParam, 'CkOAuth2_put_StateParam');
  Chilkat_GetProcedureAddress(CkOAuth2_get_ListenPortSelected, 'CkOAuth2_get_ListenPortSelected');
  Chilkat_GetProcedureAddress(CkOAuth2_get_Oob, 'CkOAuth2_get_Oob');
  Chilkat_GetProcedureAddress(CkOAuth2_put_Oob, 'CkOAuth2_put_Oob');
  Chilkat_GetProcedureAddress(CkOAuth2_get_EnableSecrets, 'CkOAuth2_get_EnableSecrets');
  Chilkat_GetProcedureAddress(CkOAuth2_put_EnableSecrets, 'CkOAuth2_put_EnableSecrets');
  Chilkat_GetProcedureAddress(CkOAuth2_StartAuth, 'CkOAuth2_StartAuth');
  Chilkat_GetProcedureAddress(CkOAuth2_Cancel, 'CkOAuth2_Cancel');
  Chilkat_GetProcedureAddress(CkOAuth2_SleepMs, 'CkOAuth2_SleepMs');
  Chilkat_GetProcedureAddress(CkOAuth2_RefreshAccessToken, 'CkOAuth2_RefreshAccessToken');
  Chilkat_GetProcedureAddress(CkOAuth2_UseConnection, 'CkOAuth2_UseConnection');
  Chilkat_GetProcedureAddress(CkOAuth2_GetRedirectRequestParam, 'CkOAuth2_GetRedirectRequestParam');
  Chilkat_GetProcedureAddress(CkOAuth2_SetRefreshHeader, 'CkOAuth2_SetRefreshHeader');
  Chilkat_GetProcedureAddress(CkOAuth2_AddTokenQueryParam, 'CkOAuth2_AddTokenQueryParam');
  Chilkat_GetProcedureAddress(CkOAuth2_AddAuthQueryParam, 'CkOAuth2_AddAuthQueryParam');
  Chilkat_GetProcedureAddress(CkOAuth2_AddRefreshQueryParam, 'CkOAuth2_AddRefreshQueryParam');
  Chilkat_GetProcedureAddress(CkOAuth2_LaunchBrowser, 'CkOAuth2_LaunchBrowser');
  Chilkat_GetProcedureAddress(CkOAuth2_ExchangeCodeForToken, 'CkOAuth2_ExchangeCodeForToken');
  Chilkat_GetProcedureAddress(CkOAuth2_GetAccessTokenResponseSb, 'CkOAuth2_GetAccessTokenResponseSb');

end.
