devicecheck | Reduce fraudulent use of your services by managing device | REST library
kandi X-RAY | devicecheck Summary
kandi X-RAY | devicecheck Summary
Reduce fraudulent use of your services by managing device state and asserting app integrity via Apple DeviceCheck API with this Python wrapper.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Validate a device check .
- Validates a device check .
- Extract device token from request .
- Extract device token .
- Get the private key string
- Generate a JWT token .
- Initialize the API .
- Return the script directory .
- Parse the response .
- Return dict representation of status code .
devicecheck Key Features
devicecheck Examples and Code Snippets
Community Discussions
Trending Discussions on devicecheck
QUESTION
I am using newest firebase sdk for auth but otp auto fill is not working. OTP SMS is successfully received, When I enter manually it is working without any issue. But I need to get that OTP automatically without user involvement.
My code:
...ANSWER
Answered 2022-Apr-04 at 09:00I faced the same issue and mine was due to the app name too long to contain the hashcode. Below are few work around:
- You need to make sure the message you receive contains the hash of your app. Below is the right format :
123456 is your verification code for %APP_NAME%.
abc_hascode_xyz
If your SMS does not contain the hashCode at the end, you might have to shorten your app name to not more than 15 characters.
If your app is already published on Google Play, the name in the SMS will be the same as the one in the Google play store.
If you changed the name to 15 characters and the error still persists, you might have to wait for at least 24hours for the change to reflect on firebase.
if after all the above it's still not resolved, please check if your receiver is well configured in the code.
check out the new GooglePlay policy on app names: Examples of common app names violations
QUESTION
All I am able to do is validate the generated X509Certificate using its method checkValidity(), but as per the steps mentioned in https://developer.apple.com/documentation/devicecheck/validating_apps_that_connect_to_your_server, we have to validate the X509Certificate using Apple App attest root certificate which is
...ANSWER
Answered 2022-Feb-22 at 12:59This app attest step is to verify the certificate chain. You will get 2 certificates in attestation request i.e. under x5c[0], x5c[1]. These are leaf and intermediate certificates.
To verify the certificate chain, x5c[0] certificate should be signed by x5c[1] and x5c[1] certificate should be signed by Apple App attest root certificate.
Sample code for this
QUESTION
I have been trying to decode the octet string as per steps mentioned in
https://developer.apple.com/documentation/devicecheck/validating_apps_that_connect_to_your_server?language=objc
Here is what I have tried:
ANSWER
Answered 2022-Feb-16 at 16:46"Octet string" is just a spec phrase that modern languages call "byte array". You've extracted the value as of octs
, and should compare that value to whatever nonce you're supposed to compare it against.
QUESTION
I recently decided to enable App Check on Firebase for an iOS app I have running for a small <300 user group. For iOS projects Firebase has two options for App Check DeviceCheck and App Attest. I was able to turn DeviceCheck on without problems by uploading my Auth Key from my Apple Developer account. Everything seems to work without problems but I am not understanding what exactly is happening under the hood as the Firebase documentation only explains how to set it up and I want to make sure it is working correctly.
Could someone explain to me how Device Check works in this scenario with Firebase and how it is different from iOS App Attest that Firebase also supports?
Firebase iOS App Check Documentation:
...ANSWER
Answered 2022-Jan-26 at 15:40How does Firebase App Check using iOS DeviceCheck work?
In short, SDKs will ask the AppCheck SDK for a special AppCheck token when making a request. When using App Check is configured to use DeviceCheck, it will generate the requested token with the help of the DeviceCheck framework.
I am not understanding what exactly is happening under the hood ...
And here's a little more detail to help clarify things:
The AppCheck SDK uses AppCheckProviders
to generate app check tokens. There are 4 types of AppCheckProvider
s:
AppAttestProvider
DeviceCheckProvider
AppCheckDebugProvider
- Custom providers that you create as a subclass of
AppCheckProvider
For certain Firebase SDKs that support AppCheck enforcement (i.e. Firestore), they will ask the AppCheck SDK for an AppCheck token when sending a request. The AppCheck SDK generates a token using one of the 4 AppCheckProviders
listed above. You can customize which provider is used by using AppCheck's AppCheck.setAppCheckProviderFactory(_:)
API. I wrote more about it's purpose in this answer.
... I want to make sure it is working correctly
If you're able to see request metrics in the Firebase console, AppCheck is implemented correctly and working. If you've enabled enforcement, you should start to see some enforced requests in the metrics graph.
Could someone explain to me how Device Check works in this scenario with Firebase ...
So when the AppCheck SDK is using the DeviceCheckProvider
(this provider is the default one!), the AppCheck SDK will be creating AppCheck tokens with the help of Apple's DeviceCheck framework.
how it (Device Check) is different from iOS App Attest that Firebase also supports?
The answer here can be found in Apple's documentation for DeviceCheck.
In short, the difference is in the two names.
Device Check is useful for verifying that requests are originating from an actual device. For example, let's say you have an iOS app and are using Firebase AppCheck with the DeviceCheckProvider
. If you enable enforcement, only requests coming from actual devices should be successful. So if I try to hit your backend API by curl
'ing a request from the command line, it should get rejected since there is no token to confirm the request is coming from an actual device. This protects the backend from such abuse.
App Attest is part of the Device Check framework and offers more advanced verification by attesting that the request is coming from a valid instance of your app. To understand why this is useful, consider your iOS app is configured to use Firebase AppCheck with the DeviceCheckProvider
. Let's say a hacker recompiles your app onto an actual device. In this case, DeviceCheck's effectiveness diminishes as requests sent from this malicious copy are technically coming from an "actual device" so a valid token will be generated. App Attest's more advanced attestation can attest that the request is coming from a valid instance of your app. In this example, the hacker's copy would not be a valid instance.
At this point, you might be wondering why you would ever use DeviceCheck when you can use the more advanced App Attest and the reason is OS availability: App Attest is only available for iOS 14.0+.
I hope this answered your questions! 🙂
QUESTION
I tried to set up app attestation between my app and php but I rarely find any other source of explaination than Apple's own documentation, which let me stuck quite at an early state. So far I got the following steps:
On the client side, following https://developer.apple.com/documentation/devicecheck/establishing_your_app_s_integrity, I creted my attestation as a base64 encoded string:
...ANSWER
Answered 2021-Oct-14 at 08:21After a while I came up with the following solution. The $x5c field contains a list of certificates, all in binary form. I wrote the folowing converter to create a ready-to-use certificate in PEM format, which does the following:
- base64 encode the binary data
- break lines after 64 bytes
- add BEGIN and END markers (also note the trailing line-break on the end certificate line)
QUESTION
I want to disable reCaptcha but I can't do that, I follow some steps from this link, but it doesn't work for me.
First I added SHA-1 and SHA-256 to the firebase project and also in the Google Cloud Console, I enabled the Android DeviceCheck API for my project. The default Firebase API Key will be used and needs to be allowed to access the DeviceCheck API.
But reCaptcha still enable, please help me.
...ANSWER
Answered 2021-Mar-15 at 12:03In integration testing section, according to official firebase document:
In addition to manual testing, Firebase Authentication provides APIs to help write integration tests for phone auth testing. These APIs disable app verification by disabling the reCAPTCHA requirement in web and silent push notifications in iOS. This makes automation testing possible in these flows and easier to implement. In addition, they help provide the ability to test instant verification flows on Android.
On Android, call setAppVerificationDisabledForTesting() before the signInWithPhoneNumber call. This disables app verification automatically, allowing you to pass the phone number without manually solving it. Note that even though reCAPTCHA and/or SafetyNet are disabled, using a real phone number will still fail to complete sign in. Only fictional phone numbers can be used with this API.
QUESTION
I'm trying use Apple's new DeviceCheck
API to verify that network calls in my app are actually coming from an uncompromised version of my app.
Documentation
...After successfully verifying a key’s attestation, your server can require the app to assert its legitimacy for any or all future server requests. The app does this by signing the request. In the app, first obtain a unique, one-time challenge from the server. You use a challenge here, like for attestation, to avoid replay attacks. Then combine the challenge with the server request to create a hash:
ANSWER
Answered 2021-Feb-22 at 12:01The point of the challenge is to avoid replay attacks, so it can be any randomised string. A UUID would be fine. It doesn't need to be a secret.
The challenge string is combined with the transaction data and a hash is generated. You send the hash to and you send that to generateAssertion
and receive the assertion object. You then send this to your server along with the request data.
Now your server can combine the received request data with the challenge (which it knows, since it sent it to the client initially), generate the same hash and validate the attestation.
The server-side attestation article provides detail on the challenge data:
Provide a Challenge
Every time your app needs to communicate attestation data to your server, the app first asks the server for a unique, one-time challenge. App Attest integrates this challenge into the objects that it provides, and that your app sends back to your server for validation. This makes it harder for an attacker to implement a replay attack.
When asked for a challenge, provide your app with a randomized data value, and remember the value for use when verifying the corresponding attestation or assertion objects sent by the client. How you use the challenge data depends on the kind of object that you need to validate.
QUESTION
This is a follow up to my previous question here however this question should be able to stand alone. I get the following error when I try to import tensorflow while there exists a file containing from tensorflow import keras
.
ANSWER
Answered 2020-Jun-07 at 08:59Allright so this is a bug. I reproduced your issue using the python
docker
container, only installing the latest tensorflow
. What fixed it, was renaming code.py
to test.py
(or anything else for that matter). This means this this is for sure a tensorflow
issue. During import tensorflow
, python
will for some reason also import your code.py
. Will you file an issue or should I?
QUESTION
I am trying to implement DeviceCheck for my app. I am new to coding and do not have the resources to build a server to be an intermediary between the client and Apple's servers. Is it possible to just query for and update the DeviceCheck bits just on the device?
I have tried converting some DeviceCheck tutorial's server code to swift but have not had any luck. Can anyone help me wit this?
...ANSWER
Answered 2020-Apr-13 at 20:06I used to have this problem too, but I decided to use a $0 non-consumable purchase since that will be recorded in the Apple receipt file. Depending on what you need it for, this could be the simplest way to do something similar to DeviceCheck without adding your own server component
QUESTION
I am trying to iterate over this vector to figure out if a function I have that checks for names in a vector is working.
...ANSWER
Answered 2020-Feb-23 at 06:03it->capabilities
is the std::vector capabilities
of the Device
pointed to by the current iterator it
. To iterate over capabilities
you'd do:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install devicecheck
You can use devicecheck like any standard Python library. You will need to make sure that you have a development environment consisting of a Python distribution including header files, a compiler, pip, and git installed. Make sure that your pip, setuptools, and wheel are up to date. When using pip it is generally recommended to install packages in a virtual environment to avoid changes to the system.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page