OAuth2 | 認証なし URL

デフォルトでは、サーバーサイドで OAuth2 が有効になっている場合、すべての HTTP リクエストにベアラートークンによる認証が必要です。

Bearer Token を使用せずにアクセスできる URL を許可したい場合は、OnOAuth2BeforeRequest イベントを使用できます。

 


procedure OnOAuth2BeforeRequest(Sender: TObject; aConnection: TsgcWSConnection; aHeaders: TStringList; 
  var Cancel: Boolean);
begin
  if DecodeGETFullPath(aHeaders) = '/Public.html' then
    Cancel := True
  else if DecodePOSTFullPath(aHeaders) = '/Form.html' then
    Cancel := True;  
end;