Integrated Windows Authentication

View on GitHub
Sample viewer app

Connect to an IWA secured Portal and search for maps.

Integrated Windows Authentication sample

Use case

Your organization might use Integrated Windows Authentication (IWA) to secure ArcGIS Enterprise. This can be useful because the same credentials used to log into your work computer and network can be used to authenticate with ArcGIS. IWA is built into Microsoft Internet Information Server (IIS) and works well for intranet applications but isn't always practical for internet apps.

How to use the sample

  1. Enter the URL to your IWA-secured portal in the text field above the Search Secure button.
  2. Tap either the Search Public button (which will search for portals on www.arcgis.com) or Search Secure button (which will search your IWA-secured portal), to search for web maps stored on the portal.
  3. If you tap Search Secure, you will be prompted for a username (including domain, such as username@DOMAIN or domain\username) and password.
  4. If you authenticate successfully, portal item results will display in the table view.
  5. Tap a web map item to display it in a map view.

How it works

  1. The AGSAuthenticationManager object is configured with a challenge handler that will prompt for a Windows login (username including domain, and password) if a secure resource is encountered.
  2. When a search for portal items is performed against an IWA-secured portal, the challenge handler creates an AGSCredential object from the information entered by the user.
  3. If the user authenticates, the search returns a list of web maps from AGSPortalItem objects and the user can select one to display as an AGSMap.

Relevant API

  • AGSPortal

About the data

This sample searches for web map portal items on a secure portal. To successfully run the sample, you need:

  • Access to a portal secured with Integrated Windows Authentication that contains one or more web map items.
  • A login that grants you access to the portal.

Additional information

More information about IWA and its use with ArcGIS can be found at the following links:

Tags

authentication, portal, security, Windows

Sample Code

IntegratedWindowsAuthenticationMapViewController.swiftIntegratedWindowsAuthenticationPortalMapBrowserViewController.swiftIntegratedWindowsAuthenticationSearchTableViewCell.swiftIntegratedWindowsAuthenticationViewController.swift
                                           
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
//
// Copyright © 2019 Esri.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//   http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//

import UIKit
import ArcGIS

/// A view controller that displays a map in a map view.
class IntegratedWindowsAuthenticationMapViewController: UIViewController {
    /// The map view managed by the view controller.
    @IBOutlet weak var mapView: AGSMapView! {
        didSet {
            mapView.map = map
        }
    }

    /// The map displayed in the map view.
    let map: AGSMap

    /// Creates a map view controller with the given map.
    ///
    /// - Parameter map: A map.
    init(map: AGSMap) {
        self.map = map
        super.init(nibName: "IntegratedWindowsAuthenticationMapViewController", bundle: nil)
    }

    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
}

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.