EMA C++ Edition
List of all members
refinitiv::ema::access::OmmOAuth2ConsumerClient Class Reference

OmmOAuth2ConsumerClient class provides callback interfaces for OAuth interactions. More...

Callbacks

virtual void onCredentialRenewal (const OmmConsumerEvent &consumerEvent)
  More...
 
 OmmOAuth2ConsumerClient ()
 
virtual ~OmmOAuth2ConsumerClient ()
 

Detailed Description

Application may implement an application client class inheriting from OmmOAuth2ConsumerClient. In its own class, application needs to override callback methods it desires to use for item processing. Default empty callback methods are implemented by OmmOAuth2ConsumerClient class.

Remarks
Thread safety of all the methods in this class depends on the user's implementation.

The following code snippet shows basic usage of OmmOAuth2ConsumerClient class to print recevied messages to screen.

class AppClient : public OmmOAuth2ConsumerClient
{
void onCredentialRenewal( const OmmConsumerEvent& );
};
void AppClient::onCredentialRenewal( const OmmConsumerEvent& event )
{
//Retrieve the credentials, then call OmmConsumer::SubmitOAuthCredentialRenewal to submit the renewed credentials.
OAuth2CredentialRenewal credentials;
// Need the OmmConsumer object to call SubmitOAuthCredentialRenewal
OmmConsumer& consumer = event.getClosure().getConsumer();
credentials.clientId("<CLIENT ID>");
credentials.clientSecret("<CLIENT_SECRET>");
consumer.SubmitOAuthCredentialRenewal(credentials);
}
virtual void onCredentialRenewal(const OmmConsumerEvent &consumerEvent)

Definition at line 63 of file OmmOAuth2ConsumerClient.h.

Member Function Documentation

◆ onCredentialRenewal()

virtual void refinitiv::ema::access::OmmOAuth2ConsumerClient::onCredentialRenewal ( const OmmConsumerEvent consumerEvent)
virtual

Invoked upon receiving a credentials request for OAuth interactions.

Parameters
[out]ommConsumerThe ommConsumer associated with this callback. The user will need to call OmmConsumer::renewOAuth2Credentials in this function to provide the updated credentials
[out]consumerEventidentifies open item for which this message is received
Returns
void