DeviceCheck

RSS for tag

Access per-device, per-developer data that your associated server can use in its business logic using DeviceCheck.

Posts under DeviceCheck tag

99 Posts

Post

Replies

Boosts

Views

Activity

403 Error During Specific Time Period with DeviceCheck API Usage
I have a question regarding the usage of the DeviceCheck API. We have been using https://api.development.devicecheck.apple.com/v1/validate_device_token for checking device tokens. However, we encountered frequent HTTP response status code 403 between 16:50 and 17:15 Japan time on June 29th. According to the official documentation at https://developer.apple.com/documentation/devicecheck/accessing_and_modifying_per-device_data, I understand that a 403 error indicates "The specified action isn't allowed". Yet, I would like to clarify under what specific circumstances this error would be returned. Please note that we do not encounter a 403 error outside the aforementioned timeframe, which leads us to believe there is no issue with our basic implementation.
1
2
1.3k
Jul ’23
Unable to renew developer program & showing 2 different expiry dates
HI, Since more than a Month i am trying to solve the issue. Issue is as under Developer program end dates on apple developer account / app and in mac book's setting> manage subscription are different. In developer application not showing renew button. When i am trying to renew from mac book manage subscription option (When wrong date is mentioned) Its giving an error that could not purchase subscription. I got 7 days extension from apple and my corrected date (in apple account on website) got properly extended. Please solve this issue on priority. I am attaching screenshots for your reference.
1
0
1.2k
Jul ’23
X and Y coordinates in App Attestation public key has mismatching length
There seem to be an issue with the DeviceCheck Framework where in rare cases the public key (ECC P-256) embedded inside the attestation object returned from DCAppAttestService.attestKey(_:clientDataHash:completionHandler:) has X and Y coordinates with mismatching length. Sometimes X or Y has 31 bytes instead of the expected 32 bytes. This can easily be reproduced by generating and attesting multiple keys using DCAppAttestService.generateKey(completionHandler:) and DCAppAttestService.attestKey(_:clientDataHash:completionHandler:). Every now and then the public key embedded inside the attestation object has X and Y coordinates with mismatching length (number of bytes). Added a Swift snippet at the bottom that shows example on how to generate and detect this. I would expect the ECC P-256 public key X and Y coordinates to always be 32 bytes long. As mentioned in the Web Authentication spec for example. I've attached an example attestation object (in base64 encoded CBOR) that has an embedded public key with mismatching X and Y coordinate length (Y is 31 bits, and not the expected 32 bits). The file was generated using the Swift snippet below. The snippet was built using Xcode 14.3 (14E222b) and ran on iPhone XR with iOS 15.7.1 (19H117). A feedback ticket has also been submitted regarding this issue: FB12235865 Swift snippet to generate and check attestation objects: import DeviceCheck import CryptoKit import SwiftCBOR // https://github.com/valpackett/SwiftCBOR ​ func generateAttestationObjects() { for i in 0..<1000 { DispatchQueue.main.asyncAfter(deadline: .now() + TimeInterval(i)) { DCAppAttestService.shared.generateKey { keyId, error in guard let keyId else { print("\(i): Failed to generate key: \(error)") return } ​ print("\(i): Generated keyId: \(keyId)") ​ DCAppAttestService.shared.attestKey( keyId, clientDataHash: Data(hex: "01020304")! ) { attestationObject, error in guard let attestationObject else { print("\(i): Failed to get attestation: \(error)") return } ​ do { let attestationObjectBytes = [UInt8](attestationObject) ​ if case let .map(decodedAttestationObject) = try CBOR.decode(attestationObjectBytes) { print("\(i): Successfully decoded Attestation object (CBOR)") ​ if case let .byteString(authData) = decodedAttestationObject["authData"] { ​ let attestedCredentialData = [UInt8](authData.dropFirst(37)) ​ let credentialIdLengthBuffer = [UInt8](attestedCredentialData[16..<18]) let credentialIdLength = Int(credentialIdLengthBuffer.reversed().withUnsafeBytes { $0.load(as: UInt16.self) }) let credentialId = [UInt8](attestedCredentialData[18..<(18 + credentialIdLength)]) let credentialPublicKeyBuffer = [UInt8](attestedCredentialData.dropFirst(18 + credentialIdLength)) ​ if let decodedCredentialPublicKey = try CBOR.decode(credentialPublicKeyBuffer) { ​ if case let .byteString(xCoordinateBuffer) = decodedCredentialPublicKey[-2], case let .byteString(yCoordinateBuffer) = decodedCredentialPublicKey[-3] { let xCoordinateLength = xCoordinateBuffer.count let yCoordinateLength = yCoordinateBuffer.count ​ if xCoordinateLength != yCoordinateLength { print("\(i): X/Y Coordinate length mismatch! X: \(xCoordinateLength), Y: \(yCoordinateLength)") } else if xCoordinateLength != 32 || yCoordinateLength != 32 { print("\(i): X/Y Coordinate length mismatch! X: \(xCoordinateLength), Y: \(yCoordinateLength)") } else { print("\(i): X/Y Coordinates OK") } } } } } } catch { print("\(i): Error decoding Attestation object (CBOR): \(error)") } } } } } } An attestation object with a embedded public key with mismatching X and Y coordinate length (base64 encoded CBOR): appattest-object-mismatching-x-y-base64.txt
1
0
1.6k
Jul ’23
Clearing out DeviceCheck state
Is it possible to clear out the existing DeviceCheck state on a developer account? (either ourselves or via Apple support) We recently built a feature that leverages DeviceCheck and did a trial run of that feature. Now there's this trial data stored in DeviceCheck that we'd like to clear out so we can start from a clean slate. I wanted to check what our options are to do this. Thanks!
0
0
895
Jun ’23
Does DeviceCheck and App Attest with Firebase's AppCheck detect Jailbroken devices?
I'm trying to prevent my App from running on jailbroken devices. For React Native apps, there is Firebase App Check, wich integrates with App Attest and DeviceCheck. I wonder, is App Attest with DeviceCheck able to detect that my App is running on a jailbroken device? I see other posts about jailbeaking on this forum, but they are mostly (or perhaps all of them) older than DeviceCheck. Which is why I'm repeating the question but asking specifically about DeviceCheck and App Attest.
0
2
1.4k
Jun ’23
Get SecKey reference to key from DCAppAttestService.generateKey()
Hello developers and apple support team. Im was quite surprised why it's not possible to get SecKey reference for key which was generated using DCAppAttestService.generateKey() Case 1. So after self.iosDeviceAttestationManager.generateKey { keyId, error in guard let keyId = keyId else { promise(.failure(error!)) return } promise(.success(keyId)) } Then Im converting keyId from string to Data using guard let keyIdData = Data(base64Encoded: keyId) else { return Fail(error: Errors.someError).eraseToAnyPublisher() } P.S. Actually I have tried convert keyId as pure string to data but it also does not work let keyIdData = keyID.data(using: .utf8)! Then Im trying to obtain this key using standard keychain API. let getquery: [String: Any] = [ kSecClass as String: kSecClassKey, kSecAttrApplicationTag as String: keyIdData, kSecAttrKeyType as String: kSecAttrKeyTypeECSECPrimeRandom, kSecReturnRef as String: true] var item: CFTypeRef? let status = SecItemCopyMatching(getquery as CFDictionary, &item) guard status == errSecSuccess else { print("SecItemCopyMatching failed. Status = \(status)") return nil } Which return me SecItemCopyMatching failed. Status = -25300 Which means that itemNot found in keychain. Why it's happening? Case 2. I have tried other way around to create ECKey using let access = SecAccessControlCreateWithFlags( kCFAllocatorDefault, kSecAttrAccessibleWhenUnlockedThisDeviceOnly, .privateKeyUsage, nil) let ECKeySize = 256 let attributes: NSDictionary = [ kSecAttrKeyType: kSecAttrKeyTypeECSECPrimeRandom, kSecAttrKeySizeInBits: ECKeySize, kSecAttrTokenID: kSecAttrTokenIDSecureEnclave, kSecPrivateKeyAttrs: [ kSecAttrIsPermanent: true, kSecAttrApplicationTag: keyTagData, kSecAttrAccessControl: access as Any ] ] var error: Unmanaged<CFError>? guard let privateKey = SecKeyCreateRandomKey(attributes as CFDictionary, &error) else { error!.takeRetainedValue() as Error return nil } and then trying to attest this key using self.iosDeviceAttestationManager.attestKey(keyId, clientDataHash: clientDataHash) { data, error in guard let data = data else { promise(.failure(error!)) return } promise(.success(data)) } But this gives me error Error Domain=com.apple.devicecheck.error Code=3 "(null)" Which states fot InvalidKey So is there any way how I could get reference to attested key to later use it for signing/verification purposes? Thanks, in advance!
3
6
2.0k
Apr ’23
Apple DeviceCheck and Unsafe legacy renegotiation disabled
I'm writing some PHP code in my server in order to use the Apple devicecheck service when getting a request from my iOS app. When testing locally (dev environment) everything seems to work fine, however when testing from my online host the connection to the Apple service is failing with the error: cURL error 35: error:0A000152:SSL routines::unsafe legacy renegotiation disabled Has anyone else encountered this issue with DeviceCheck? From what I've been able to investigate, it seems that the issue is related to the OpenSSL versions in the client (in this case, my online host) and the server (Apple servers), with the latter being on a lower patch version. This is causing the connection to fail with the 'unsafe legacy renegotiation disabled' error message. If this is indeed the cause of the issue, is there no other solution than to wait for Apple to patch their servers? Or is there something that I can do on my end to resolve this? Any help or guidance would be appreciated.
1
0
1.6k
Mar ’23
How does Apple certify the keys and queries of an application using App Attest?
Hello, I've already made a previous similar post but it's getting a bit old so I'm re-launching it. I am currently developing an iOS application using AppCheck with AppAttest. I have read Apple's documentation on AppAttest to understand how it works. However, there is a part I didn't understand. When the public key is to be shared, Apple will create a certificate to attest that this public key belongs to an official instance of my application. Here is what it says about this verification on the official website : How does the Apple server identify that the key comes from an official instance of my application ? I can also rephrase my question as follows: How does the apple server detect an unofficial instance of my application if the data it receives for this check comes from it directly (I assume and I am probably wrong) and can therefore be falsified ? Is this a secret process to which I cannot have access, this answer would also suit me ? Thanks for your attention !
5
0
3.8k
Feb ’23
DeviceCheck values appear to reset in Dev environment?
I'm testing out an app that will be using the DeviceCheck framwork / API to enable a one-time free trial. I'm testing using the deveopment URL provided in the documentation (https://api.development.devicecheck.apple.com). I had set the bits for one of my test iOS devices several days ago. Today when I went to do some additional testing the query_two_bits response came back with "200 Bit State Not Found" - what the API apparently returns for a device that has never had the DeviceCheck value set. I tried it several times before I executed another update_two_bits call, which succeeded. Subsequent calls to the query endpoint returned 200 OK and the expected bit values.It's probably worth mentioning that the unexpected behavior happened after I had deleted and re-installed the app. The app's bundle ID did not changed, but I did enable Push Notifications yesterday.My question is: is the development version of DeviceCheck less "permanent" than the production version (i.e. does everything get deleted after X days)?Or, unlike in the production environment, does deleting and reinstalling the app change something that causes DeviceCheck to not recognize the device by subsequently generated DC tokens?Or does making a change to the app's configuration in AppStoreConnect (i.e. enabling Push) make some change that causes DeviceCheck to not recognize the device by subsequently generated DC tokens?Or is it most likely that something has broken in my environment or code?Thanks -S
2
0
2.1k
Dec ’22
DCAppAttestService generateAssertion invalidInput
Hi! Sometimes when calling DCAppAttestService.shared.generateAssertion(key.id, clientDataHash: hash) I'm getting DCError.Code.invalidInput. I am formatting clientDataHash usingSHA256.hash - so it is always 32 bytes long. As I found out - this error depends on hash that I pass to generateAssertion method. But I could not find any system - which hashes are good and which are not. Keys are always correct, otherwise invalidKey error would be risen. What can cause the issue? I'm testing on iPhone 11, iOS 15.2.1
2
0
2.5k
Sep ’22
API: DeviceCheck, statusCode: 401, message: Unable to verify authorization token
I am submitting the JWT with required payload to https://api.development.devicecheck.apple.com/v1/validate_device_token. However Apple's development devicecheck server always returns http response 401 - Unable to verify authorization token.  I generated the token following the instructions in https://developer.apple.com/documentation/appstoreconnectapi/generating_tokens_for_api_requests and check token by curl -v -H 'Authorization: Bearer [signed token]' "https://api.appstoreconnect.apple.com/v1/apps" I can use that token to call this API successfully. However, when I tried to use exactly the same token to verify a device ID, I got a 401 response here is my payload for the request https://api.devicecheck.apple.com/v1/validate_device_token It's my code: now = int(time.time()) expire_time = now + 20 * 60 HEADERS = { &#9;&#9;"alg": "ES256", &#9;&#9;"kid": kid, &#9;&#9;"typ": "JWT" } PAYLOAD = { &#9;&#9;'exp': expire_time, &#9;&#9;'iss': iss, &#9;&#9;'aud': "appstoreconnect-v1" } jwt_token = jwt.encode(PAYLOAD, private_key, algorithm='ES256', headers=HEADERS).decode('utf-8') auth = 'Bearer {}'.format(jwt_token) headers = { &#9;&#9;'Content-Type': 'application/x-www-form-urlencoded', &#9;&#9;'Authorization': auth } response = requests.get( &#9;&#9;'https://api.appstoreconnect.apple.com/v1/apps', &#9;&#9;headers=headers ) print(response.status_code) print(response.text) request_file = '.../ValidateDeviceTokenRequest.json' data = None with open(request_file) as json_file: &#9;&#9;data = json.load(json_file) data['timestamp'] = (now) * 1000 response = requests.post( &#9;&#9;'https://api.devicecheck.apple.com/v1/validate_device_token', &#9;&#9;data=json.dumps(data).encode(), &#9;&#9;headers=headers ) print(response.status_code) print(response.text)
2
0
3.0k
Jul ’22
403 Error During Specific Time Period with DeviceCheck API Usage
I have a question regarding the usage of the DeviceCheck API. We have been using https://api.development.devicecheck.apple.com/v1/validate_device_token for checking device tokens. However, we encountered frequent HTTP response status code 403 between 16:50 and 17:15 Japan time on June 29th. According to the official documentation at https://developer.apple.com/documentation/devicecheck/accessing_and_modifying_per-device_data, I understand that a 403 error indicates "The specified action isn't allowed". Yet, I would like to clarify under what specific circumstances this error would be returned. Please note that we do not encounter a 403 error outside the aforementioned timeframe, which leads us to believe there is no issue with our basic implementation.
Replies
1
Boosts
2
Views
1.3k
Activity
Jul ’23
Uniquely Identify iOS Device
How to uniquely identify the device to prevent fraudulent activity in any financial Apps? since UUID also gets changed on every installation, is there any option to track the device like how it is done with IMEI number ? Note: Our App is targeted for normal Appstore users.
Replies
2
Boosts
0
Views
1.9k
Activity
Jul ’23
Unable to renew developer program & showing 2 different expiry dates
HI, Since more than a Month i am trying to solve the issue. Issue is as under Developer program end dates on apple developer account / app and in mac book's setting> manage subscription are different. In developer application not showing renew button. When i am trying to renew from mac book manage subscription option (When wrong date is mentioned) Its giving an error that could not purchase subscription. I got 7 days extension from apple and my corrected date (in apple account on website) got properly extended. Please solve this issue on priority. I am attaching screenshots for your reference.
Replies
1
Boosts
0
Views
1.2k
Activity
Jul ’23
AppAttest assertion fails if user OS is updated
I have observed few users if their OS upgrades than the DeviceCheck generateAssertion API fails. Is it expected that we need to attest/register new key id iOS version is updated ?
Replies
0
Boosts
1
Views
1.1k
Activity
Jul ’23
X and Y coordinates in App Attestation public key has mismatching length
There seem to be an issue with the DeviceCheck Framework where in rare cases the public key (ECC P-256) embedded inside the attestation object returned from DCAppAttestService.attestKey(_:clientDataHash:completionHandler:) has X and Y coordinates with mismatching length. Sometimes X or Y has 31 bytes instead of the expected 32 bytes. This can easily be reproduced by generating and attesting multiple keys using DCAppAttestService.generateKey(completionHandler:) and DCAppAttestService.attestKey(_:clientDataHash:completionHandler:). Every now and then the public key embedded inside the attestation object has X and Y coordinates with mismatching length (number of bytes). Added a Swift snippet at the bottom that shows example on how to generate and detect this. I would expect the ECC P-256 public key X and Y coordinates to always be 32 bytes long. As mentioned in the Web Authentication spec for example. I've attached an example attestation object (in base64 encoded CBOR) that has an embedded public key with mismatching X and Y coordinate length (Y is 31 bits, and not the expected 32 bits). The file was generated using the Swift snippet below. The snippet was built using Xcode 14.3 (14E222b) and ran on iPhone XR with iOS 15.7.1 (19H117). A feedback ticket has also been submitted regarding this issue: FB12235865 Swift snippet to generate and check attestation objects: import DeviceCheck import CryptoKit import SwiftCBOR // https://github.com/valpackett/SwiftCBOR ​ func generateAttestationObjects() { for i in 0..<1000 { DispatchQueue.main.asyncAfter(deadline: .now() + TimeInterval(i)) { DCAppAttestService.shared.generateKey { keyId, error in guard let keyId else { print("\(i): Failed to generate key: \(error)") return } ​ print("\(i): Generated keyId: \(keyId)") ​ DCAppAttestService.shared.attestKey( keyId, clientDataHash: Data(hex: "01020304")! ) { attestationObject, error in guard let attestationObject else { print("\(i): Failed to get attestation: \(error)") return } ​ do { let attestationObjectBytes = [UInt8](attestationObject) ​ if case let .map(decodedAttestationObject) = try CBOR.decode(attestationObjectBytes) { print("\(i): Successfully decoded Attestation object (CBOR)") ​ if case let .byteString(authData) = decodedAttestationObject["authData"] { ​ let attestedCredentialData = [UInt8](authData.dropFirst(37)) ​ let credentialIdLengthBuffer = [UInt8](attestedCredentialData[16..<18]) let credentialIdLength = Int(credentialIdLengthBuffer.reversed().withUnsafeBytes { $0.load(as: UInt16.self) }) let credentialId = [UInt8](attestedCredentialData[18..<(18 + credentialIdLength)]) let credentialPublicKeyBuffer = [UInt8](attestedCredentialData.dropFirst(18 + credentialIdLength)) ​ if let decodedCredentialPublicKey = try CBOR.decode(credentialPublicKeyBuffer) { ​ if case let .byteString(xCoordinateBuffer) = decodedCredentialPublicKey[-2], case let .byteString(yCoordinateBuffer) = decodedCredentialPublicKey[-3] { let xCoordinateLength = xCoordinateBuffer.count let yCoordinateLength = yCoordinateBuffer.count ​ if xCoordinateLength != yCoordinateLength { print("\(i): X/Y Coordinate length mismatch! X: \(xCoordinateLength), Y: \(yCoordinateLength)") } else if xCoordinateLength != 32 || yCoordinateLength != 32 { print("\(i): X/Y Coordinate length mismatch! X: \(xCoordinateLength), Y: \(yCoordinateLength)") } else { print("\(i): X/Y Coordinates OK") } } } } } } catch { print("\(i): Error decoding Attestation object (CBOR): \(error)") } } } } } } An attestation object with a embedded public key with mismatching X and Y coordinate length (base64 encoded CBOR): appattest-object-mismatching-x-y-base64.txt
Replies
1
Boosts
0
Views
1.6k
Activity
Jul ’23
Clearing out DeviceCheck state
Is it possible to clear out the existing DeviceCheck state on a developer account? (either ourselves or via Apple support) We recently built a feature that leverages DeviceCheck and did a trial run of that feature. Now there's this trial data stored in DeviceCheck that we'd like to clear out so we can start from a clean slate. I wanted to check what our options are to do this. Thanks!
Replies
0
Boosts
0
Views
895
Activity
Jun ’23
Does DeviceCheck and App Attest with Firebase's AppCheck detect Jailbroken devices?
I'm trying to prevent my App from running on jailbroken devices. For React Native apps, there is Firebase App Check, wich integrates with App Attest and DeviceCheck. I wonder, is App Attest with DeviceCheck able to detect that my App is running on a jailbroken device? I see other posts about jailbeaking on this forum, but they are mostly (or perhaps all of them) older than DeviceCheck. Which is why I'm repeating the question but asking specifically about DeviceCheck and App Attest.
Replies
0
Boosts
2
Views
1.4k
Activity
Jun ’23
Get SecKey reference to key from DCAppAttestService.generateKey()
Hello developers and apple support team. Im was quite surprised why it's not possible to get SecKey reference for key which was generated using DCAppAttestService.generateKey() Case 1. So after self.iosDeviceAttestationManager.generateKey { keyId, error in guard let keyId = keyId else { promise(.failure(error!)) return } promise(.success(keyId)) } Then Im converting keyId from string to Data using guard let keyIdData = Data(base64Encoded: keyId) else { return Fail(error: Errors.someError).eraseToAnyPublisher() } P.S. Actually I have tried convert keyId as pure string to data but it also does not work let keyIdData = keyID.data(using: .utf8)! Then Im trying to obtain this key using standard keychain API. let getquery: [String: Any] = [ kSecClass as String: kSecClassKey, kSecAttrApplicationTag as String: keyIdData, kSecAttrKeyType as String: kSecAttrKeyTypeECSECPrimeRandom, kSecReturnRef as String: true] var item: CFTypeRef? let status = SecItemCopyMatching(getquery as CFDictionary, &item) guard status == errSecSuccess else { print("SecItemCopyMatching failed. Status = \(status)") return nil } Which return me SecItemCopyMatching failed. Status = -25300 Which means that itemNot found in keychain. Why it's happening? Case 2. I have tried other way around to create ECKey using let access = SecAccessControlCreateWithFlags( kCFAllocatorDefault, kSecAttrAccessibleWhenUnlockedThisDeviceOnly, .privateKeyUsage, nil) let ECKeySize = 256 let attributes: NSDictionary = [ kSecAttrKeyType: kSecAttrKeyTypeECSECPrimeRandom, kSecAttrKeySizeInBits: ECKeySize, kSecAttrTokenID: kSecAttrTokenIDSecureEnclave, kSecPrivateKeyAttrs: [ kSecAttrIsPermanent: true, kSecAttrApplicationTag: keyTagData, kSecAttrAccessControl: access as Any ] ] var error: Unmanaged<CFError>? guard let privateKey = SecKeyCreateRandomKey(attributes as CFDictionary, &error) else { error!.takeRetainedValue() as Error return nil } and then trying to attest this key using self.iosDeviceAttestationManager.attestKey(keyId, clientDataHash: clientDataHash) { data, error in guard let data = data else { promise(.failure(error!)) return } promise(.success(data)) } But this gives me error Error Domain=com.apple.devicecheck.error Code=3 "(null)" Which states fot InvalidKey So is there any way how I could get reference to attested key to later use it for signing/verification purposes? Thanks, in advance!
Replies
3
Boosts
6
Views
2.0k
Activity
Apr ’23
DeviceCheck is down?
The addresses api.devicecheck.apple.com and api.development.devicecheck.apple.com are down, at the moment. Why isn't this service listed in the developer status monitor (https://developer.apple.com/system-status/)?
Replies
1
Boosts
0
Views
1.3k
Activity
Apr ’23
Apple DeviceCheck and Unsafe legacy renegotiation disabled
I'm writing some PHP code in my server in order to use the Apple devicecheck service when getting a request from my iOS app. When testing locally (dev environment) everything seems to work fine, however when testing from my online host the connection to the Apple service is failing with the error: cURL error 35: error:0A000152:SSL routines::unsafe legacy renegotiation disabled Has anyone else encountered this issue with DeviceCheck? From what I've been able to investigate, it seems that the issue is related to the OpenSSL versions in the client (in this case, my online host) and the server (Apple servers), with the latter being on a lower patch version. This is causing the connection to fail with the 'unsafe legacy renegotiation disabled' error message. If this is indeed the cause of the issue, is there no other solution than to wait for Apple to patch their servers? Or is there something that I can do on my end to resolve this? Any help or guidance would be appreciated.
Replies
1
Boosts
0
Views
1.6k
Activity
Mar ’23
How does Apple certify the keys and queries of an application using App Attest?
Hello, I've already made a previous similar post but it's getting a bit old so I'm re-launching it. I am currently developing an iOS application using AppCheck with AppAttest. I have read Apple's documentation on AppAttest to understand how it works. However, there is a part I didn't understand. When the public key is to be shared, Apple will create a certificate to attest that this public key belongs to an official instance of my application. Here is what it says about this verification on the official website : How does the Apple server identify that the key comes from an official instance of my application ? I can also rephrase my question as follows: How does the apple server detect an unofficial instance of my application if the data it receives for this check comes from it directly (I assume and I am probably wrong) and can therefore be falsified ? Is this a secret process to which I cannot have access, this answer would also suit me ? Thanks for your attention !
Replies
5
Boosts
0
Views
3.8k
Activity
Feb ’23
Limits and quotas on DeviceCheck / AppAttest APIs
Hello, I would simply like to know where i can find the information regarding the quotas and limits for using DeviceCheck / AppAttest APIs please. Thanks
Replies
2
Boosts
3
Views
3.6k
Activity
Jan ’23
DeviceCheck values appear to reset in Dev environment?
I'm testing out an app that will be using the DeviceCheck framwork / API to enable a one-time free trial. I'm testing using the deveopment URL provided in the documentation (https://api.development.devicecheck.apple.com). I had set the bits for one of my test iOS devices several days ago. Today when I went to do some additional testing the query_two_bits response came back with "200 Bit State Not Found" - what the API apparently returns for a device that has never had the DeviceCheck value set. I tried it several times before I executed another update_two_bits call, which succeeded. Subsequent calls to the query endpoint returned 200 OK and the expected bit values.It's probably worth mentioning that the unexpected behavior happened after I had deleted and re-installed the app. The app's bundle ID did not changed, but I did enable Push Notifications yesterday.My question is: is the development version of DeviceCheck less "permanent" than the production version (i.e. does everything get deleted after X days)?Or, unlike in the production environment, does deleting and reinstalling the app change something that causes DeviceCheck to not recognize the device by subsequently generated DC tokens?Or does making a change to the app's configuration in AppStoreConnect (i.e. enabling Push) make some change that causes DeviceCheck to not recognize the device by subsequently generated DC tokens?Or is it most likely that something has broken in my environment or code?Thanks -S
Replies
2
Boosts
0
Views
2.1k
Activity
Dec ’22
DeviceCheck Dev reset
How often does the devicecheck values reset on DEV environment? From what I see, it seems to be 24h. Can anyone confirm?
Replies
0
Boosts
0
Views
1.1k
Activity
Dec ’22
DeviceCheck: generateToken() fails to return token in Xcode Cloud
DeviceCheck: generateToken() fails to return token in Xcode Cloud for macOS. The device token is always nil. How does one write test with that API ? Skipping the test is an option but then defeats the purpose.
Replies
0
Boosts
0
Views
1.1k
Activity
Oct ’22
What is the meaning of this error => Error Domain=com.apple.devicecheck.error Code=2 "(null)"
I have encountered this error while using "service.generateAssertion". But I am not understanding what does this error mean exactly.
Replies
0
Boosts
0
Views
1.6k
Activity
Sep ’22
App Attest counter value reset to 0
Hi, I am new to iOS development and currently studying App Attest functionality. Can someone confirm why the counter value be 0 during attestation validation at the server side. And also, can this value be reset to 0 at any point of time? Do we need to do code signoff as well for using App Attest?
Replies
1
Boosts
0
Views
2.2k
Activity
Sep ’22
DCAppAttestService generateAssertion invalidInput
Hi! Sometimes when calling DCAppAttestService.shared.generateAssertion(key.id, clientDataHash: hash) I'm getting DCError.Code.invalidInput. I am formatting clientDataHash usingSHA256.hash - so it is always 32 bytes long. As I found out - this error depends on hash that I pass to generateAssertion method. But I could not find any system - which hashes are good and which are not. Keys are always correct, otherwise invalidKey error would be risen. What can cause the issue? I'm testing on iPhone 11, iOS 15.2.1
Replies
2
Boosts
0
Views
2.5k
Activity
Sep ’22
error on developer account enrollment
I tried to enroll a developer account but it shows that we cant enroll now . and we tried so many times ,there is no error reference as well , is there anyone met this kind of situation before, really appreciate if you could share your experience. thanks so much
Replies
0
Boosts
0
Views
789
Activity
Aug ’22
API: DeviceCheck, statusCode: 401, message: Unable to verify authorization token
I am submitting the JWT with required payload to https://api.development.devicecheck.apple.com/v1/validate_device_token. However Apple's development devicecheck server always returns http response 401 - Unable to verify authorization token.  I generated the token following the instructions in https://developer.apple.com/documentation/appstoreconnectapi/generating_tokens_for_api_requests and check token by curl -v -H 'Authorization: Bearer [signed token]' "https://api.appstoreconnect.apple.com/v1/apps" I can use that token to call this API successfully. However, when I tried to use exactly the same token to verify a device ID, I got a 401 response here is my payload for the request https://api.devicecheck.apple.com/v1/validate_device_token It's my code: now = int(time.time()) expire_time = now + 20 * 60 HEADERS = { &#9;&#9;"alg": "ES256", &#9;&#9;"kid": kid, &#9;&#9;"typ": "JWT" } PAYLOAD = { &#9;&#9;'exp': expire_time, &#9;&#9;'iss': iss, &#9;&#9;'aud': "appstoreconnect-v1" } jwt_token = jwt.encode(PAYLOAD, private_key, algorithm='ES256', headers=HEADERS).decode('utf-8') auth = 'Bearer {}'.format(jwt_token) headers = { &#9;&#9;'Content-Type': 'application/x-www-form-urlencoded', &#9;&#9;'Authorization': auth } response = requests.get( &#9;&#9;'https://api.appstoreconnect.apple.com/v1/apps', &#9;&#9;headers=headers ) print(response.status_code) print(response.text) request_file = '.../ValidateDeviceTokenRequest.json' data = None with open(request_file) as json_file: &#9;&#9;data = json.load(json_file) data['timestamp'] = (now) * 1000 response = requests.post( &#9;&#9;'https://api.devicecheck.apple.com/v1/validate_device_token', &#9;&#9;data=json.dumps(data).encode(), &#9;&#9;headers=headers ) print(response.status_code) print(response.text)
Replies
2
Boosts
0
Views
3.0k
Activity
Jul ’22