adobe / acc-js-sdk

A JavaScript SDK for Adobe Campaign Classic
Apache License 2.0
21 stars 20 forks source link

ofImsBearerToken connection method now has the ability to return session info. As this method is not yet available on the server, some workaround is used involving mulitple API calls #92

Closed mkiki closed 11 months ago

mkiki commented 11 months ago

Description

When using the ofUserAndPassword or ofBearerToken logon methods, a session object is returned containing information about the server and the user. This is not available when using the new ofImsBearerToken because this type of authentication uses a Bearer token obtained outside of Campaign and does not actually perform any SOAP call.

Related Issue

The issue is that some clients of the SDK expect to have this user and session information. While there's no API for this yet, this PR implements a workaround to get most of the information. This workaround involves multiple API calls.

it's not active by default, one must use the "sessionInfo" boolean option to activate

  const connectionParameters = sdk.ConnectionParameters.ofImsBearerToken(utils.url, 'ey...', { sessionInfo: true });

Motivation and Context

Backwards compatibility with other connection methods

How Has This Been Tested?

Unit tests Test on a real instance

Types of changes

Checklist: