diff --git a/ApplicationLibCode/Commands/OsduImportCommands/RiaOsduConnector.cpp b/ApplicationLibCode/Commands/OsduImportCommands/RiaOsduConnector.cpp index 8c1dcfc92a..c9dc9e4c1c 100644 --- a/ApplicationLibCode/Commands/OsduImportCommands/RiaOsduConnector.cpp +++ b/ApplicationLibCode/Commands/OsduImportCommands/RiaOsduConnector.cpp @@ -50,7 +50,7 @@ RiaOsduConnector::RiaOsduConnector( QObject* parent, &QOAuth2AuthorizationCodeFlow::authorizeWithBrowser, []( QUrl url ) { - RiaLogging::info( "Authorize with url: " + url.toString() ); + RiaLogging::debug( "Authorize with url: " + url.toString() ); QUrlQuery query( url ); url.setQuery( query ); QDesktopServices::openUrl( url ); @@ -68,8 +68,18 @@ RiaOsduConnector::RiaOsduConnector( QObject* parent, auto replyHandler = new RiaOsduOAuthHttpServerReplyHandler( port, this ); m_osdu->setReplyHandler( replyHandler ); + RiaLogging::debug( "Osdu server callback: " + replyHandler->callback() ); connect( m_osdu, SIGNAL( granted() ), this, SLOT( accessGranted() ) ); + connect( m_osdu, + SIGNAL( error( const QString&, const QString&, const QUrl& ) ), + this, + SLOT( errorReceived( const QString&, const QString&, const QUrl& ) ) ); + + connect( m_osdu, + SIGNAL( authorizationCallbackReceived( const QVariantMap& ) ), + this, + SLOT( authorizationCallbackReceived( const QVariantMap& ) ) ); } //-------------------------------------------------------------------------------------------------- @@ -77,10 +87,31 @@ RiaOsduConnector::RiaOsduConnector( QObject* parent, //-------------------------------------------------------------------------------------------------- void RiaOsduConnector::accessGranted() { + RiaLogging::debug( "Access granted." ); m_token = m_osdu->token(); emit tokenReady( m_token ); } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RiaOsduConnector::errorReceived( const QString& error, const QString& errorDescription, const QUrl& uri ) +{ + RiaLogging::debug( "OSDU Error Received: " + error + ". Description: " + errorDescription ); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RiaOsduConnector::authorizationCallbackReceived( const QVariantMap& data ) +{ + RiaLogging::debug( "Authorization callback received:" ); + for ( const auto& [key, value] : data.toStdMap() ) + { + RiaLogging::debug( " Key: " + key + " Value: " + value.toString() ); + } +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationLibCode/Commands/OsduImportCommands/RiaOsduConnector.h b/ApplicationLibCode/Commands/OsduImportCommands/RiaOsduConnector.h index b474416f2e..32a0f44c1d 100644 --- a/ApplicationLibCode/Commands/OsduImportCommands/RiaOsduConnector.h +++ b/ApplicationLibCode/Commands/OsduImportCommands/RiaOsduConnector.h @@ -102,6 +102,10 @@ signals: void wellLogsFinished( const QString& wellboreId ); void tokenReady( const QString& token ); +private slots: + void errorReceived( const QString& error, const QString& errorDescription, const QUrl& uri ); + void authorizationCallbackReceived( const QVariantMap& data ); + private: void requestParquetData( const QString& url, const QString& dataPartitionId, const QString& token );