ক্লায়েন্ট সিক্রেটস
সেভ করা পৃষ্ঠা গুছিয়ে রাখতে 'সংগ্রহ' ব্যবহার করুন আপনার পছন্দ অনুযায়ী কন্টেন্ট সেভ করুন ও সঠিক বিভাগে রাখুন।
.NET-এর জন্য Google APIs ক্লায়েন্ট লাইব্রেরি client_id
, client_secret
, এবং অন্যান্য OAuth 2.0 প্যারামিটার সংরক্ষণের জন্য client_secrets.json
ফাইল ব্যবহার করে।
একটি client_secrets.json
ফাইল হল একটি JSON ফর্ম্যাট করা ফাইল যাতে ক্লায়েন্ট আইডি, ক্লায়েন্ট সিক্রেট এবং অন্যান্য OAuth 2.0 প্যারামিটার থাকে। এখানে একটি ওয়েব অ্যাপ্লিকেশনের জন্য client_secrets.json
ফাইলের একটি উদাহরণ রয়েছে:
{ "web": { "client_id": "asdfjasdljfasdkjf", "client_secret": "1912308409123890", "redirect_uris": ["https://www.example.com/oauth2callback"], "auth_uri": "https://accounts.google.com/o/oauth2/auth", "token_uri": "https://accounts.google.com/o/oauth2/token" } }
একটি ইনস্টল করা অ্যাপ্লিকেশনের জন্য এখানে একটি উদাহরণ client_secrets.json
ফাইল রয়েছে:
{ "installed": { "client_id": "837647042410-75ifg...usercontent.com", "client_secret":"asdlkfjaskd", "redirect_uris": ["http://localhost"], "auth_uri": "https://accounts.google.com/o/oauth2/auth", "token_uri": "https://accounts.google.com/o/oauth2/token" } }
বিন্যাস দুটি ক্লায়েন্ট আইডি প্রকারের একটিকে সংজ্ঞায়িত করে:
-
web
: ওয়েব অ্যাপ্লিকেশন। -
installed
: ইনস্টল করা অ্যাপ্লিকেশন।
web
এবং installed
সাব-অবজেক্টের নিম্নলিখিত বাধ্যতামূলক সদস্য রয়েছে:
-
client_id
(স্ট্রিং): ক্লায়েন্ট আইডি। -
client_secret
(স্ট্রিং): ক্লায়েন্ট সিক্রেট।
এই ফাইলের অন্য সব সদস্য ঐচ্ছিক এবং .NET ক্লায়েন্ট লাইব্রেরি তাদের ব্যবহার করে না।
প্রেরণা
ঐতিহ্যগতভাবে, OAuth 2.0 এন্ডপয়েন্টের প্রদানকারীরা আশা করে যে যারা তাদের পরিষেবাগুলি ব্যবহার করে ক্লায়েন্ট আইডি এবং ক্লায়েন্ট সিক্রেট একটি রেজিস্ট্রেশন পৃষ্ঠা থেকে কার্যকারী কোডে কপি এবং পেস্ট করতে। এই পদ্ধতিটি ত্রুটি-প্রবণ এবং OAuth 2.0 কাজ করার জন্য প্রয়োজনীয় তথ্যের একটি অসম্পূর্ণ ছবি দেয়। (OAuth 2.0-এর জন্যও সমস্ত শেষ পয়েন্ট জানার প্রয়োজন, এবং একটি পুনঃনির্দেশিত URI কনফিগার করা প্রয়োজন।) যদি পরিষেবা প্রদানকারীরা ডাউনলোডযোগ্য client_secrets.json
ফাইলগুলি সরবরাহ করে এবং ক্লায়েন্ট লাইব্রেরিগুলি এই ফাইলগুলি ব্যবহার করার জন্য প্রস্তুত থাকে, তাহলে OAuth 2.0 বাস্তবায়ন করা সহজ হবে এবং ত্রুটির ঝুঁকি কম হবে৷
অন্য কিছু উল্লেখ না করা থাকলে, এই পৃষ্ঠার কন্টেন্ট Creative Commons Attribution 4.0 License-এর অধীনে এবং কোডের নমুনাগুলি Apache 2.0 License-এর অধীনে লাইসেন্স প্রাপ্ত। আরও জানতে, Google Developers সাইট নীতি দেখুন। Java হল Oracle এবং/অথবা তার অ্যাফিলিয়েট সংস্থার রেজিস্টার্ড ট্রেডমার্ক।
2025-07-24 UTC-তে শেষবার আপডেট করা হয়েছে।
[[["সহজে বোঝা যায়","easyToUnderstand","thumb-up"],["আমার সমস্যার সমাধান হয়েছে","solvedMyProblem","thumb-up"],["অন্যান্য","otherUp","thumb-up"]],[["এতে আমার প্রয়োজনীয় তথ্য নেই","missingTheInformationINeed","thumb-down"],["খুব জটিল / অনেক ধাপ","tooComplicatedTooManySteps","thumb-down"],["পুরনো","outOfDate","thumb-down"],["অনুবাদ সংক্রান্ত সমস্যা","translationIssue","thumb-down"],["নমুনা / কোড সংক্রান্ত সমস্যা","samplesCodeIssue","thumb-down"],["অন্যান্য","otherDown","thumb-down"]],["2025-07-24 UTC-তে শেষবার আপডেট করা হয়েছে।"],[[["\u003cp\u003eThe Google APIs client library for .NET utilizes \u003ccode\u003eclient_secrets.json\u003c/code\u003e files to store OAuth 2.0 credentials like \u003ccode\u003eclient_id\u003c/code\u003e, \u003ccode\u003eclient_secret\u003c/code\u003e, and other parameters.\u003c/p\u003e\n"],["\u003cp\u003eThese JSON files define client ID types as either \u003ccode\u003eweb\u003c/code\u003e for web applications or \u003ccode\u003einstalled\u003c/code\u003e for installed applications, each requiring \u003ccode\u003eclient_id\u003c/code\u003e and \u003ccode\u003eclient_secret\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eUsing \u003ccode\u003eclient_secrets.json\u003c/code\u003e files simplifies OAuth 2.0 implementation by providing a centralized, downloadable configuration instead of manual entry, reducing errors.\u003c/p\u003e\n"]]],[],null,["# Client Secrets\n\nThe Google APIs client library for .NET uses\n`client_secrets.json` files for storing the\n`client_id`, `client_secret`, and other OAuth 2.0 parameters.\n\nA `client_secrets.json`\nfile is a [JSON](http://www.json.org/) formatted file\ncontaining the client ID, client secret, and other OAuth 2.0 parameters.\nHere is an example `client_secrets.json` file for a web application: \n\n```\n{\n \"web\": {\n \"client_id\": \"asdfjasdljfasdkjf\",\n \"client_secret\": \"1912308409123890\",\n \"redirect_uris\": [\"https://www.example.com/oauth2callback\"],\n \"auth_uri\": \"https://accounts.google.com/o/oauth2/auth\",\n \"token_uri\": \"https://accounts.google.com/o/oauth2/token\"\n }\n}\n```\n\n\nHere is an example `client_secrets.json` file for an installed application: \n\n```\n{\n \"installed\": {\n \"client_id\": \"837647042410-75ifg...usercontent.com\",\n \"client_secret\":\"asdlkfjaskd\",\n \"redirect_uris\": [\"http://localhost\"],\n \"auth_uri\": \"https://accounts.google.com/o/oauth2/auth\",\n \"token_uri\": \"https://accounts.google.com/o/oauth2/token\"\n }\n}\n```\n\n\nThe format defines one of two client ID types:\n\n- `web`: Web application.\n- `installed`: Installed application.\n\n\nThe `web` and `installed` sub-objects have\nthe following mandatory members:\n\n- `client_id` (string): The client ID.\n- `client_secret` (string): The client secret.\n\n\nAll the other members of this file are optional and\nthe .NET client library doesn't use them.\n\nMotivation\n----------\n\n\nTraditionally, providers of OAuth 2.0 endpoints have expected\nthose who use their services to copy and paste the client ID\nand client secret from a registration page into working code.\nThis method is error-prone and gives an incomplete picture\nof the information that is needed to get OAuth 2.0 working.\n(OAuth 2.0 also requires knowing all the endpoints,\nand configuring a redirect URI.)\n\nIf service providers provide downloadable `client_secrets.json`\nfiles, and client libraries are prepared to consume these files,\nthen implementing OAuth 2.0 will be easier and less prone to error."]]