<!--
{
  "availability" : [
    "iOS: 26.0.0 -",
    "iPadOS: 26.0.0 -",
    "macCatalyst: 26.0.0 -",
    "macOS: 26.0.0 -",
    "visionOS: 26.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AuthenticationServices",
  "identifier" : "/documentation/AuthenticationServices/ASImportableCredential/BasicAuthentication",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "Authentication Services"
    ],
    "preciseIdentifier" : "s:22AuthenticationServices22ASImportableCredentialO05BasicA0V"
  },
  "title" : "ASImportableCredential.BasicAuthentication"
}
-->

# ASImportableCredential.BasicAuthentication

A type to represent a basic authentication password.

```
struct BasicAuthentication
```

## Overview

This type is a representation of `BasicAuth` as defined in the Credential Exchange Format (CXF) specification.

## Topics

### Accessing authentication properties

[`var password: ASImportableEditableField?`](/documentation/AuthenticationServices/ASImportableCredential/BasicAuthentication/password)

The password associated with the credential.

[`struct ASImportableEditableField`](/documentation/AuthenticationServices/ASImportableEditableField)

A field that someone can edit within a credential.

### Initializers

[`init(userName: ASImportableEditableField?, password: ASImportableEditableField?)`](/documentation/AuthenticationServices/ASImportableCredential/BasicAuthentication/init(userName:password:))

### Instance Properties

[`var userName: ASImportableEditableField?`](/documentation/AuthenticationServices/ASImportableCredential/BasicAuthentication/userName)

The user name associated with this credential. When instantiating from JSON, this property will be populated from the “username” field.

## Relationships

### Conforms To

[`Encodable`](/documentation/Swift/Encodable)

[`Hashable`](/documentation/Swift/Hashable)

[`Decodable`](/documentation/Swift/Decodable)

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

[`Sendable`](/documentation/Swift/Sendable)

[`Equatable`](/documentation/Swift/Equatable)

---

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)