Unity projelerinde App Check ile özel arka uç kaynaklarını koruma
Koleksiyonlar ile düzeninizi koruyun
İçeriği tercihlerinize göre kaydedin ve kategorilere ayırın.
Uygulamanız için Google dışı özel arka uç kaynaklarını (ör. kendi kendine barındırılan arka ucunuz) korumak üzere App Check kullanabilirsiniz. Bunun için aşağıdakilerin ikisini de yapmanız gerekir:
Uygulama istemcinizi, bu sayfada açıklandığı gibi, arka uçunuza gönderilen her istekle birlikte bir App Check jetonu gönderecek şekilde değiştirin.
Arka uç istekleriyle Uygulama Kontrolü jetonları gönderme
Arka uç isteklerinizin geçerli ve süresi dolmamış bir Uygulama Kontrolü jetonu içerdiğinden emin olmak için her isteğin önüne FirebaseAppCheck.GetAppCheckTokenAsync() çağrısı ekleyin.
App Check kitaplığı, gerekirse jetonu yeniler.
Geçerli bir jetonunuz olduğunda, istekle birlikte arka ucunuza gönderin. Bunu nasıl yapacağınız size bağlıdır ancak App Check jetonlarını URL'lerin bir parçası olarak göndermeyin. Sorgu parametreleri de buna dahildir. Bu, jetonların yanlışlıkla sızdırılmasına ve saldırıya uğramasına neden olur. Jetonu özel bir HTTP üstbilgisinde göndermeniz önerilir.
Örneğin:
voidCallApiExample(){FirebaseAppCheck.DefaultInstance.GetAppCheckToken(false).ContinueWithOnMainThread(task=>{if(!task.IsFaulted){// Got a valid App Check token. Include it in your own http calls.}});}
[[["Anlaması kolay","easyToUnderstand","thumb-up"],["Sorunumu çözdü","solvedMyProblem","thumb-up"],["Diğer","otherUp","thumb-up"]],[["İhtiyacım olan bilgiler yok","missingTheInformationINeed","thumb-down"],["Çok karmaşık / çok fazla adım var","tooComplicatedTooManySteps","thumb-down"],["Güncel değil","outOfDate","thumb-down"],["Çeviri sorunu","translationIssue","thumb-down"],["Örnek veya kod sorunu","samplesCodeIssue","thumb-down"],["Diğer","otherDown","thumb-down"]],["Son güncelleme tarihi: 2025-08-23 UTC."],[],[],null,["\u003cbr /\u003e\n\nYou can use App Check to protect non-Google custom backend resources for\nyour app, like your own self-hosted backend. To do so, you'll need to do both of\nthe following:\n\n- Modify your app client to send an App Check token along with each request to your backend, as described on this page.\n- Modify your backend to require a valid App Check token with every request, as described in [Verify App Check tokens from a custom backend](/docs/app-check/custom-resource-backend).\n\nBefore you begin\n\nAdd App Check to your app, using the [default providers](/docs/app-check/unity/default-providers).\n\nSend App Check tokens with backend requests\n\nTo ensure your backend requests include a valid, unexpired, App Check token,\nprecede each request with a call to `FirebaseAppCheck.GetAppCheckTokenAsync()`.\nThe App Check library will refresh the token if necessary.\n\nOnce you have a valid token, send it along with the request to your backend. The\nspecifics of how you accomplish this are up to you, but *don't send\nApp Check tokens as part of URLs*, including in query parameters, as this\nmakes them vulnerable to accidental leakage and interception. The recommended\napproach is to send the token in a custom HTTP header.\n\nFor example: \n\n void CallApiExample() {\n FirebaseAppCheck.DefaultInstance.GetAppCheckToken(false).\n ContinueWithOnMainThread(task =\u003e {\n if (!task.IsFaulted) {\n // Got a valid App Check token. Include it in your own http calls.\n }\n });\n }"]]