<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic OAuth2 without QML | Toolbox (Existing application) in Qt Maps SDK Questions</title>
    <link>https://community.esri.com/t5/qt-maps-sdk-questions/oauth2-without-qml-toolbox-existing-application/m-p/1571768#M5381</link>
    <description>&lt;P&gt;Hi!&lt;BR /&gt;I am trying to get OAuth2 to work within my existing application.&lt;BR /&gt;This application is currently using the&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;PRE&gt;Esri::ArcGISRuntime::ArcGISRuntimeEnvironment::&lt;SPAN&gt;setApiKey&lt;/SPAN&gt;("***")&lt;/PRE&gt;&lt;P&gt;method to set the API key, but we want to change this to OAuth.,&lt;BR /&gt;I have been looking at all the examples but it doesn't seem very useful for my implementation.&lt;BR /&gt;&lt;BR /&gt;I figured out what url to call and I am able to go through the login from within my QT Desktop application.&lt;BR /&gt;I figured out I can change the "redirect-url" to "my-application://oauth" which will automatically open/re-activate my application after login.&lt;BR /&gt;&lt;BR /&gt;Where I am stuck is that (atleast under OSX) I can not intercept that&amp;nbsp; call in QT (when my application is already open)&lt;BR /&gt;&lt;BR /&gt;Calling the following url, anyone knows what "&lt;SPAN&gt;response_type"s are available, perhaps that could help me out.&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV&gt;&lt;PRE&gt;QString authUrl = QString&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;"https://www.arcgis.com/sharing/rest/oauth2/authorize?client_id=%1&amp;amp;redirect_uri=%2&amp;amp;response_type=code"&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;BR /&gt;&lt;/SPAN&gt;                      .&lt;SPAN&gt;arg&lt;/SPAN&gt;(clientId)&lt;BR /&gt;                      .&lt;SPAN&gt;arg&lt;/SPAN&gt;(redirectUri)&lt;/PRE&gt;&lt;/DIV&gt;&lt;P&gt;&lt;BR /&gt;Does anyone know how to intercept the redirect from the QWebview or how to filter the specific event under OSX (and Windows/Linux) and what should I do with the token?&lt;BR /&gt;&lt;BR /&gt;A link to some actual documentation instead of QML examples would be great too!!&lt;/P&gt;&lt;/DIV&gt;</description>
    <pubDate>Mon, 30 Dec 2024 20:42:10 GMT</pubDate>
    <dc:creator>FlipVernooij</dc:creator>
    <dc:date>2024-12-30T20:42:10Z</dc:date>
    <item>
      <title>OAuth2 without QML | Toolbox (Existing application)</title>
      <link>https://community.esri.com/t5/qt-maps-sdk-questions/oauth2-without-qml-toolbox-existing-application/m-p/1571768#M5381</link>
      <description>&lt;P&gt;Hi!&lt;BR /&gt;I am trying to get OAuth2 to work within my existing application.&lt;BR /&gt;This application is currently using the&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;PRE&gt;Esri::ArcGISRuntime::ArcGISRuntimeEnvironment::&lt;SPAN&gt;setApiKey&lt;/SPAN&gt;("***")&lt;/PRE&gt;&lt;P&gt;method to set the API key, but we want to change this to OAuth.,&lt;BR /&gt;I have been looking at all the examples but it doesn't seem very useful for my implementation.&lt;BR /&gt;&lt;BR /&gt;I figured out what url to call and I am able to go through the login from within my QT Desktop application.&lt;BR /&gt;I figured out I can change the "redirect-url" to "my-application://oauth" which will automatically open/re-activate my application after login.&lt;BR /&gt;&lt;BR /&gt;Where I am stuck is that (atleast under OSX) I can not intercept that&amp;nbsp; call in QT (when my application is already open)&lt;BR /&gt;&lt;BR /&gt;Calling the following url, anyone knows what "&lt;SPAN&gt;response_type"s are available, perhaps that could help me out.&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV&gt;&lt;PRE&gt;QString authUrl = QString&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;"https://www.arcgis.com/sharing/rest/oauth2/authorize?client_id=%1&amp;amp;redirect_uri=%2&amp;amp;response_type=code"&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;BR /&gt;&lt;/SPAN&gt;                      .&lt;SPAN&gt;arg&lt;/SPAN&gt;(clientId)&lt;BR /&gt;                      .&lt;SPAN&gt;arg&lt;/SPAN&gt;(redirectUri)&lt;/PRE&gt;&lt;/DIV&gt;&lt;P&gt;&lt;BR /&gt;Does anyone know how to intercept the redirect from the QWebview or how to filter the specific event under OSX (and Windows/Linux) and what should I do with the token?&lt;BR /&gt;&lt;BR /&gt;A link to some actual documentation instead of QML examples would be great too!!&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 30 Dec 2024 20:42:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/qt-maps-sdk-questions/oauth2-without-qml-toolbox-existing-application/m-p/1571768#M5381</guid>
      <dc:creator>FlipVernooij</dc:creator>
      <dc:date>2024-12-30T20:42:10Z</dc:date>
    </item>
    <item>
      <title>Re: OAuth2 without QML | Toolbox (Existing application)</title>
      <link>https://community.esri.com/t5/qt-maps-sdk-questions/oauth2-without-qml-toolbox-existing-application/m-p/1572292#M5382</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/542881"&gt;@FlipVernooij&lt;/a&gt;&amp;nbsp;. Without using our toolkit components, it will be difficult to process OAuth2 manually. It's doable, but we handle all the details in our toolkit code.&lt;/P&gt;&lt;P&gt;I recently did some R&amp;amp;D on the workflow you're attempting, and some of the details are in a branch. Note, some of that branch is based on code that doesn't exist yet in our product (and may never), so take it with a grain of salt.&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/Esri/arcgis-maps-sdk-toolkit-qt/blob/james/oauth_callback_spike/uitools/toolkitcpp/cpp/Esri/ArcGISRuntime/Toolkit/ArcGISAuthenticationController.cpp#L162-L199" target="_blank"&gt;https://github.com/Esri/arcgis-maps-sdk-toolkit-qt/blob/james/oauth_callback_spike/uitools/toolkitcpp/cpp/Esri/ArcGISRuntime/Toolkit/ArcGISAuthenticationController.cpp#L162-L199&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/Esri/arcgis-maps-sdk-toolkit-qt/blob/james/oauth_callback_spike/uitools/toolkitcpp/cpp/Esri/ArcGISRuntime/Toolkit/CustomOAuth2AuthorizationCodeFlow.cpp" target="_blank"&gt;https://github.com/Esri/arcgis-maps-sdk-toolkit-qt/blob/james/oauth_callback_spike/uitools/toolkitcpp/cpp/Esri/ArcGISRuntime/Toolkit/CustomOAuth2AuthorizationCodeFlow.cpp&lt;/A&gt;&lt;/P&gt;&lt;P&gt;These are based on Qt's newer OAuth support classes. Refer to&amp;nbsp;&lt;A href="https://doc.qt.io/qt-6/qoauthurischemereplyhandler.html#ios-and-macos" target="_blank"&gt;https://doc.qt.io/qt-6/qoauthurischemereplyhandler.html#ios-and-macos&lt;/A&gt;&amp;nbsp;for how to setup the callback URI scheme and register your app. I tried this on macOS and couldn't get it working, but I was mostly focused on iOS and Android.&lt;/P&gt;&lt;P&gt;These recommendations are for the out-of-process browser login experience. If you're ok with using the WebView, which will callback to the same app, you can use "urn:ietf:wg:oauth:2.0:oob" as your callback URI. That is what we currently do in our toolkit.&lt;/P&gt;&lt;P&gt;If you're working with arcgis services, then take a look at&amp;nbsp;&lt;A href="https://developers.arcgis.com/documentation/security-and-authentication/user-authentication/oauth-credentials-user/" target="_blank"&gt;https://developers.arcgis.com/documentation/security-and-authentication/user-authentication/oauth-credentials-user/&lt;/A&gt;&amp;nbsp;for how to configure this and register your callback URI/URL.&lt;/P&gt;</description>
      <pubDate>Thu, 02 Jan 2025 22:59:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/qt-maps-sdk-questions/oauth2-without-qml-toolbox-existing-application/m-p/1572292#M5382</guid>
      <dc:creator>JamesBallard1</dc:creator>
      <dc:date>2025-01-02T22:59:36Z</dc:date>
    </item>
    <item>
      <title>Re: OAuth2 without QML | Toolbox (Existing application)</title>
      <link>https://community.esri.com/t5/qt-maps-sdk-questions/oauth2-without-qml-toolbox-existing-application/m-p/1572295#M5383</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/542881"&gt;@FlipVernooij&lt;/a&gt;&amp;nbsp;I should add that we do have a toolkit for Qt Widgets as well, and our OAuth2 sign in workflow is supported there as well. It just doesn't have any examples to go along with it.&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/Esri/arcgis-maps-sdk-toolkit-qt/blob/main/uitools/toolkitwidgets/docs/AuthenticationView.md" target="_blank"&gt;https://github.com/Esri/arcgis-maps-sdk-toolkit-qt/blob/main/uitools/toolkitwidgets/docs/AuthenticationView.md&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 02 Jan 2025 23:01:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/qt-maps-sdk-questions/oauth2-without-qml-toolbox-existing-application/m-p/1572295#M5383</guid>
      <dc:creator>JamesBallard1</dc:creator>
      <dc:date>2025-01-02T23:01:47Z</dc:date>
    </item>
  </channel>
</rss>

