---
title: password
framework: foundation
role: symbol
role_heading: Instance Property
path: foundation/urlcredential/password
---

# password

The credential’s password.

## Declaration

```swift
var password: String? { get }
```

## Discussion

Discussion You should only access this property if you need the actual password value. If you only need to know if there is a password, use hasPassword. Accessing this property may result in prompting the user for access—for example, if the password is stored in the user’s keychain.

## See Also

### Getting credential properties

- [user](foundation/urlcredential/user.md)
- [certificates](foundation/urlcredential/certificates.md)
- [hasPassword](foundation/urlcredential/haspassword.md)
- [identity](foundation/urlcredential/identity.md)
- [persistence](foundation/urlcredential/persistence-swift.property.md)
- [URLCredential.Persistence](foundation/urlcredential/persistence-swift.enum.md)
