<!--
{
  "availability" : [
    "macOS: 10.4.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "ImageCaptureCore",
  "identifier" : "/documentation/ImageCaptureCore/ICScannerDevice/requestOpenSession(withCredentials:password:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "ImageCaptureCore"
    ],
    "preciseIdentifier" : "c:objc(cs)ICScannerDevice(im)requestOpenSessionWithCredentials:password:"
  },
  "title" : "requestOpenSession(withCredentials:password:)"
}
-->

# requestOpenSession(withCredentials:password:)

Opens a session on the protected device with the authorized username and passcode.

```
func requestOpenSession(withCredentials username: String, password: String)
```

## Discussion

If the device reports a failure of credentials, you can provide them here for the launch. A client must open a session on a device in order to use the device.

Before calling this method, set the receiver’s delegate; otherwise, the request is ignored.

Once the request to open the session has completed, [`device(_:didOpenSessionWithError:)`](/documentation/ImageCaptureCore/ICDeviceDelegate/device(_:didOpenSessionWithError:)) is called on the delegate.

No more messages are sent to the delegate if this request fails.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)