<!--
{
  "availability" : [
    "iOS: 13.0.0 -",
    "iPadOS: 13.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.15.0 -",
    "tvOS: 13.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 6.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AuthenticationServices",
  "identifier" : "/documentation/AuthenticationServices/ASAuthorizationAppleIDProvider/getCredentialState(forUserID:completion:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Authentication Services"
    ],
    "preciseIdentifier" : "c:objc(cs)ASAuthorizationAppleIDProvider(im)getCredentialStateForUserID:completion:"
  },
  "title" : "getCredentialState(forUserID:completion:)"
}
-->

# getCredentialState(forUserID:completion:)

Returns the credential state for the given user in a completion handler.

```
func getCredentialState(forUserID userID: String, completion: @escaping @Sendable (ASAuthorizationAppleIDProvider.CredentialState, (any Error)?) -> Void)
```

## Parameters

`userID`

An opaque string associated with the Apple ID that your app receives in the credential’s [`user`](/documentation/AuthenticationServices/ASAuthorizationAppleIDCredential/user) property after performing a successful authentication request.

`completion`

A block the method calls to report the state and an optional error condition.

---

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)