Codeunit 7801 Azure Functions Code Auth, source in 28
Source242526272829metadata in 28
src/System Application/App/Azure Function/AzureFunctionsCodeAuth.Codeunit.al40 lines, Copyright (c) Microsoft Corporation. MIT
// ------------------------------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
// ------------------------------------------------------------------------------------------------
namespace System.Azure.Functions;
using System.Utilities;
codeunit 7801 "Azure Functions Code Auth" implements "Azure Functions Authentication"
{
Access = Internal;
InherentEntitlements = X;
InherentPermissions = X;
var
[NonDebuggable]
AuthenticationCodeGlobal, EndpointGlobal : Text;
[NonDebuggable]
procedure SetAuthParameters(Endpoint: Text; AuthenticationCode: Text)
begin
AuthenticationCodeGlobal := AuthenticationCode;
EndpointGlobal := Endpoint;
end;
[NonDebuggable]
procedure Authenticate(var RequestMessage: HttpRequestMessage): Boolean
var
Uri: Codeunit Uri;
UriBuilder: Codeunit "Uri Builder";
begin
UriBuilder.Init(EndpointGlobal);
UriBuilder.AddQueryParameter('Code', AuthenticationCodeGlobal);
UriBuilder.GetUri(Uri);
RequestMessage.SetRequestUri(Uri.GetAbsoluteUri());
exit(true);
end;
}