---
title: "requestOpenSession(withCredentials:password:)"
framework: imagecapturecore
role: symbol
role_heading: Instance Method
path: "imagecapturecore/icscannerdevice/requestopensession(withcredentials:password:)"
---

# requestOpenSession(withCredentials:password:)

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

## Declaration

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

## Discussion

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:) is called on the delegate. No more messages are sent to the delegate if this request fails.

## See Also

### Performing a Scan

- [requestOverviewScan()](imagecapturecore/icscannerdevice/requestoverviewscan().md)
- [requestScan()](imagecapturecore/icscannerdevice/requestscan().md)
- [cancelScan()](imagecapturecore/icscannerdevice/cancelscan().md)
- [documentName](imagecapturecore/icscannerdevice/documentname.md)
- [documentUTI](imagecapturecore/icscannerdevice/documentuti.md)
- [downloadsDirectory](imagecapturecore/icscannerdevice/downloadsdirectory.md)
- [transferMode](imagecapturecore/icscannerdevice/transfermode.md)
- [maxMemoryBandSize](imagecapturecore/icscannerdevice/maxmemorybandsize.md)
