Usina BRAdvPL Guide
Sign in
← All topics
CLASSUnder review

FWoAuthClient

FWoAuthClient():New(cConsumer,cSecret,oURL,[cCallback])

Configures a documented OAuth-client stage.

FWoAuthClientAdvPL
01 · OVERVIEW

Overview

OAuth client configured with consumer, secret, URLs, tokens and signing settings. Documented HTTP/request/authorization stages do not establish OAuth 2 automatic refresh-token handling. RequestToken can populate token and secret token; setters merely assign object values rather than proving a provider grant. This example wraps construction without requesting tokens, consuming endpoints or logging secrets. (Sources: refs. 1–1.)

02 · SYNTAX

Syntax

FWoAuthClient():New(cConsumer,cSecret,oURL,[cCallback])

Parameters

cConsumer
CharacterRequired

Consumer key from protected configuration.

cSecret
CharacterRequired

Consumer secret; never log it.

oURL
ObjectRequired

Configured FWoAuthURL instance.

cCallback
CharacterOptional

Provider-registered callback when applicable.

Methods

NewPrepares client configuration.FWoAuthClient():New(cConsumer,cSecret,oURL,[cCallback])
SetToken / SetSecretTokenAssign token values to the object.o:SetToken(cToken) / o:SetSecretToken(cSecretToken)
RequestTokenRequests a token under configured endpoints; unused here.o:RequestToken()
03 · PRACTICAL EXAMPLE

Commented example

#Include "Protheus.ch"

User Function Ed442()
    Local bPrepare := {|cKey,cSecret,oUrls,cCallback| FWoAuthClient():New(cKey,cSecret,oUrls,cCallback)}
    // Do not evaluate: configuration comes from protected storage.
Return Nil
Expected result

Prepared configuration without authentication or external communication. Under review: editorial example neither compiled nor run in Protheus. Check includes, release, RDD and context before testing.

BEST PRACTICES
  • Keep secrets out of source and logs; verify endpoints, signing, permissions and provider behavior before use.
  • Under review: editorial example neither compiled nor run in Protheus. Check includes, release, RDD and context before testing.

Related content

REFERENCES
  1. TOTVS. FWoAuthClient. TDN. Accessed on 2026-10-27.
Status
Under review
Page created on
Last reviewed on
Original language
Portuguese
Reviewed by
Usina.BR
0 approved comment(s)

Comments

There are no approved comments yet.

Sign in with Google or Microsoft to comment.

Powered by Usina Docs · Alpha