setHttpAuthCredential method
- @SupportedPlatforms.new(platforms: [AndroidPlatform(), IOSPlatform(apiName: 'URLCredentialStorage.set', apiUrl: 'https://developer.apple.com/documentation/foundation/urlcredentialstorage/1407227-set'), MacOSPlatform(apiName: 'URLCredentialStorage.set', apiUrl: 'https://developer.apple.com/documentation/foundation/urlcredentialstorage/1407227-set'), LinuxPlatform(note: 'Implemented using libsecret for secure storage.')])
- required URLProtectionSpace protectionSpace,
- required URLCredential credential,
Saves an HTTP auth credential for that protectionSpace.
Officially Supported Platforms/Implementations:
- Android WebView
- iOS WKWebView (Official API - URLCredentialStorage.set)
- macOS WKWebView (Official API - URLCredentialStorage.set)
- Linux WPE WebKit:
- Implemented using libsecret for secure storage.
Parameters - Officially Supported Platforms/Implementations:
protectionSpace: all platformscredential: all platforms
Use the PlatformHttpAuthCredentialDatabase.isMethodSupported method to check if this method is supported at runtime.
Implementation
@SupportedPlatforms(
platforms: [
AndroidPlatform(),
IOSPlatform(
apiName: 'URLCredentialStorage.set',
apiUrl:
'https://developer.apple.com/documentation/foundation/urlcredentialstorage/1407227-set',
),
MacOSPlatform(
apiName: 'URLCredentialStorage.set',
apiUrl:
'https://developer.apple.com/documentation/foundation/urlcredentialstorage/1407227-set',
),
LinuxPlatform(note: 'Implemented using libsecret for secure storage.'),
],
)
Future<void> setHttpAuthCredential({
required URLProtectionSpace protectionSpace,
required URLCredential credential,
}) {
throw UnimplementedError(
'setHttpAuthCredential is not implemented on the current platform',
);
}