A class that provides passwords that an MDM admin provisions for a managed app or extension.
Create an instance of this class when your app needs to access passwords that the MDM admin provisions for your app from their MDM server.
Members (3)
get · iOS 18.4+
identifiers
TypeScript
get identifiers(): Promise<SDKHandle>
Swift declaration
var identifiers: some AsyncSequence<Array<String>, Never> { get async }
An asynchronous sequence of arrays of password identifiers provided by the MDM server.
Use ``ManagedAppPasswordsProvider/password(withIdentifier:)`` to look up an identifier
to obtain the associated password. The sequence yields an array of identifiers when:
* You begin iterating this property using `for await`.
* The list of password identifiers changes.
* The value of one or more passwords changes.
You define the values of the identifiers that an MDM admin can use. Define specific individual values or ranges of
values to group passwords, or use the configuration to determine the meaning of the identifiers.
This property yields an empty array if the MDM admin hasn't provisioned any passwords for your app.
Provides a password by its identifier.
The MDM server can update the password at any time. After that, ``ManagedAppIdentitiesProvider/identifiers`` yields a new array of identifiers. Call this method again to obtain the updated password.
The MDM server can change the available passwords at any time. When that happens, the list of valid identifiers updates accordingly. For example, the list of valid identifiers might change between the time that the app accesses
``ManagedAppIdentitiesProvider/identifiers`` and then calls this method passing in one of its elements. So, the app needs to handle the case that this method throws ``ManagedAppError/invalidIdentifier``.
- Important: Avoid storing the password and instead, call this method whenever the app needs the password. For security reasons, avoid logging or displaying the password.
- Parameter identifier: The identifier of the requested password. This function throws ``ManagedAppError/invalidIdentifier`` if the value you supply isn't currently in ``ManagedAppIdentitiesProvider/identifiers``.
- Returns: The requested password.
- Throws: ``ManagedAppError/invalidIdentifier`` if no password exists with the specified identifier.