In this SDK, all aspects of ArcGIS and network authentication have been encapsulated into a single ArcGIS Maps SDK for Qt toolkit component called the Authenticator. This component supports multiple types of authentication challenges, including ArcGIS authentication methods (OAuth and ArcGIS token), Integrated Windows Authentication (IWA), and Client Certificate (PKI). It also provides default user interfaces for login prompts, certificate selection prompts, and server trust dialogs. For example, here is the default alert prompting the user for username and password credentials:

The Authenticator provides a default experience for handling authentication challenges with the ArcGIS Maps SDK for Qt. The Authenticator determines which type of authentication is in use and initiates the proper backend controller and UI components.
Using the Authenticator toolkit component
To use the Authenticator, do the following:
Have your Qt project reference the location of the toolkit via in the appropriate build system files (either qmake or CMake):
qmake
- If you chose the qmake build system, edit your apps .pro file (typically created if you used the ArcGIS Maps SDK for Qt template wizards), add an include statement that points to the path of the
toolkit.pri
file that you have on disk.
include($$PWD/arcgisruntime.pri) # <-- Locate this existing line in your project
# Include this toolkit pri qmake file directly afterwards
include(<path_to_toolkit_repo>/uitools/toolkitcpp/toolkitcpp.pri) # example: C:/arcgis-maps-sdk-toolkit-qt/uitools/toolkitcpp/toolkitcpp.pri
CMake
-
If you chose the CMake build system, copy the
toolkitcpp
and thecommon
subdirectories into your project's directory. -
Edit the
C
in your Qt project (created by the ArcGIS Maps SDK for Qt template wizard). Uncomment theMake Lists.txt add
and_subdirectory target
commands:_link _libraries
# To integrate the toolkit, copy the `toolkitcpp` subdirectory from the toolkit
# into your project's directory. Then uncomment the following lines to add it to your project.
# See https://github.com/Esri/arcgis-maps-sdk-toolkit-qt for details
add_subdirectory(toolkitcpp)
target_link_libraries(${PROJECT_NAME} PRIVATE libtoolkitcpp)
In your app's .qml file (for the QML UI part of your project) add the following import statement:
import Esri.ArcGISRuntime.Toolkit
In the same .qml file declare the Authenticator QML component:.
Authenticator {
anchors.centerIn: parent
}
NOTE: OAuth 2.0 uses a WebView. To use OAuth, you must call Qt
before the QGuiApplication instance is created. See Qt WebView.
A full tutorial for setting up the Authenticator is available in the developer guide tutorial Access services with OAuth credentials.