অ্যাকাউন্টগুলি ইন্ডাস্ট্রি স্ট্যান্ডার্ড OAuth 2.0 অন্তর্নিহিত এবং অনুমোদন কোড ফ্লো ব্যবহার করে লিঙ্ক করা হয়। আপনার পরিষেবা অবশ্যই OAuth 2.0 অনুগত অনুমোদন এবং টোকেন বিনিময় শেষ পয়েন্ট সমর্থন করবে৷
অন্তর্নিহিত প্রবাহে, Google ব্যবহারকারীর ব্রাউজারে আপনার অনুমোদনের শেষ পয়েন্ট খোলে। সফল সাইন ইন করার পরে, আপনি Google-এ একটি দীর্ঘস্থায়ী অ্যাক্সেস টোকেন ফেরত দেন। এই অ্যাক্সেস টোকেনটি এখন Google থেকে পাঠানো প্রতিটি অনুরোধে অন্তর্ভুক্ত করা হয়েছে।
অনুমোদন কোড প্রবাহে, আপনার দুটি শেষ পয়েন্ট প্রয়োজন:
অনুমোদন এন্ডপয়েন্ট, যা আপনার ব্যবহারকারীদের সাইন-ইন UI উপস্থাপন করে যারা ইতিমধ্যে সাইন ইন করেনি। অনুমোদনের শেষ পয়েন্টটি অনুরোধ করা অ্যাক্সেসে ব্যবহারকারীদের সম্মতি রেকর্ড করার জন্য একটি স্বল্প-কালীন অনুমোদন কোডও তৈরি করে।
টোকেন এক্সচেঞ্জ এন্ডপয়েন্ট, যা দুই ধরনের এক্সচেঞ্জের জন্য দায়ী:
- একটি দীর্ঘস্থায়ী রিফ্রেশ টোকেন এবং একটি স্বল্পকালীন অ্যাক্সেস টোকেনের জন্য একটি অনুমোদন কোড বিনিময় করে৷ এই বিনিময়টি ঘটে যখন ব্যবহারকারী অ্যাকাউন্ট লিঙ্কিং প্রবাহের মধ্য দিয়ে যায়।
- একটি স্বল্পকালীন অ্যাক্সেস টোকেনের জন্য দীর্ঘস্থায়ী রিফ্রেশ টোকেন বিনিময় করে। Google এর একটি নতুন অ্যাক্সেস টোকেনের প্রয়োজন হলে এই বিনিময়টি ঘটে কারণ এটির মেয়াদ শেষ হয়ে গেছে।
একটি OAuth 2.0 ফ্লো বেছে নিন
যদিও অন্তর্নিহিত প্রবাহ প্রয়োগ করা সহজ, Google সুপারিশ করে যে অন্তর্নিহিত প্রবাহ দ্বারা জারি করা অ্যাক্সেস টোকেন কখনই মেয়াদ শেষ হবে না। এর কারণ হল একটি টোকেন অন্তর্নিহিত প্রবাহের সাথে মেয়াদ শেষ হওয়ার পরে ব্যবহারকারীকে তাদের অ্যাকাউন্ট আবার লিঙ্ক করতে বাধ্য করা হয়। নিরাপত্তার কারণে আপনার টোকেনের মেয়াদ শেষ হওয়ার প্রয়োজন হলে, আমরা দৃঢ়ভাবে সুপারিশ করছি যে আপনি পরিবর্তে অনুমোদন কোড প্রবাহ ব্যবহার করুন।
ডিজাইন নির্দেশিকা
এই বিভাগে আপনি OAuth লিঙ্কিং ফ্লোগুলির জন্য হোস্ট করা ব্যবহারকারী স্ক্রিনের জন্য ডিজাইনের প্রয়োজনীয়তা এবং সুপারিশগুলি বর্ণনা করে৷ Google-এর অ্যাপ দ্বারা এটিকে কল করার পরে, আপনার প্ল্যাটফর্মটি Google পৃষ্ঠায় একটি সাইন ইন এবং ব্যবহারকারীকে অ্যাকাউন্ট লিঙ্ক করার সম্মতি স্ক্রীন প্রদর্শন করে। অ্যাকাউন্ট লিঙ্ক করতে তাদের সম্মতি দেওয়ার পরে ব্যবহারকারীকে Google-এর অ্যাপে ফেরত পাঠানো হয়।
প্রয়োজনীয়তা
- আপনাকে অবশ্যই যোগাযোগ করতে হবে যে ব্যবহারকারীর অ্যাকাউন্টটি Google-এর সাথে লিঙ্ক করা হবে, Google Home বা Google Assistant-এর মতো নির্দিষ্ট Google পণ্যের সাথে নয় ।
সুপারিশ
আমরা আপনাকে নিম্নলিখিতগুলি করার পরামর্শ দিই:
Google এর গোপনীয়তা নীতি প্রদর্শন করুন। সম্মতি স্ক্রিনে Google-এর গোপনীয়তা নীতির একটি লিঙ্ক অন্তর্ভুক্ত করুন।
ডেটা শেয়ার করতে হবে। ব্যবহারকারীকে তাদের Google-এর কোন ডেটা প্রয়োজন এবং কেন তা জানাতে স্পষ্ট এবং সংক্ষিপ্ত ভাষা ব্যবহার করুন৷
কল-টু-অ্যাকশন পরিষ্কার করুন। আপনার সম্মতি স্ক্রিনে একটি স্পষ্ট কল-টু-অ্যাকশন বলুন, যেমন "সম্মতি দিন এবং লিঙ্ক করুন।" এর কারণ হল ব্যবহারকারীদের বুঝতে হবে তাদের অ্যাকাউন্ট লিঙ্ক করার জন্য Google-এর সাথে কী ডেটা শেয়ার করতে হবে।
বাতিল করার ক্ষমতা। ব্যবহারকারীরা লিঙ্ক না করা বেছে নিলে তাদের ফিরে যেতে বা বাতিল করার একটি উপায় প্রদান করুন।
সাইন-ইন প্রক্রিয়া পরিষ্কার করুন। নিশ্চিত করুন যে ব্যবহারকারীদের তাদের Google অ্যাকাউন্টে সাইন ইন করার জন্য পরিষ্কার পদ্ধতি আছে, যেমন তাদের ব্যবহারকারীর নাম এবং পাসওয়ার্ডের জন্য ক্ষেত্র বা Google দিয়ে সাইন ইন করুন ।
লিঙ্কমুক্ত করার ক্ষমতা। ব্যবহারকারীদের আনলিঙ্ক করার জন্য একটি প্রক্রিয়া অফার করুন, যেমন আপনার প্ল্যাটফর্মে তাদের অ্যাকাউন্ট সেটিংসের URL। বিকল্পভাবে, আপনি Google অ্যাকাউন্টে একটি লিঙ্ক অন্তর্ভুক্ত করতে পারেন যেখানে ব্যবহারকারীরা তাদের লিঙ্ক করা অ্যাকাউন্ট পরিচালনা করতে পারে।
ব্যবহারকারীর অ্যাকাউন্ট পরিবর্তন করার ক্ষমতা। ব্যবহারকারীদের তাদের অ্যাকাউন্ট(গুলি) পরিবর্তন করার জন্য একটি পদ্ধতির পরামর্শ দিন। এটি বিশেষত উপকারী যদি ব্যবহারকারীদের একাধিক অ্যাকাউন্ট থাকে।
- যদি কোনো ব্যবহারকারীকে অ্যাকাউন্ট পাল্টানোর জন্য সম্মতি স্ক্রীন বন্ধ করতে হয়, Google-এ একটি পুনরুদ্ধারযোগ্য ত্রুটি পাঠান যাতে ব্যবহারকারী OAuth লিঙ্কিং এবং অন্তর্নিহিত প্রবাহের মাধ্যমে পছন্দসই অ্যাকাউন্টে সাইন ইন করতে পারেন।
আপনার লোগো অন্তর্ভুক্ত করুন. সম্মতি স্ক্রিনে আপনার কোম্পানির লোগো দেখান। আপনার লোগো স্থাপন করতে আপনার শৈলী নির্দেশিকা ব্যবহার করুন. আপনি যদি Google-এর লোগোও প্রদর্শন করতে চান, লোগো এবং ট্রেডমার্ক দেখুন।
প্রকল্পটি তৈরি করুন
অ্যাকাউন্ট লিঙ্কিং ব্যবহার করার জন্য আপনার প্রকল্প তৈরি করতে:
- Go to the Google API Console.
- প্রকল্প তৈরি করুন ক্লিক করুন ।
- একটি নাম লিখুন বা উত্পন্ন পরামর্শ গ্রহণ করুন।
- নিশ্চিত করুন বা কোনও অবশিষ্ট ক্ষেত্র সম্পাদনা করুন।
- তৈরি ক্লিক করুন ।
আপনার প্রকল্পের আইডি দেখতে:
- Go to the Google API Console.
- অবতরণ পৃষ্ঠায় সারণীতে আপনার প্রকল্পটি সন্ধান করুন। প্রকল্প আইডি আইডি কলামে প্রদর্শিত হবে।
আপনার OAuth সম্মতি স্ক্রীন কনফিগার করুন
Google অ্যাকাউন্ট লিঙ্ক করার প্রক্রিয়ার মধ্যে একটি সম্মতি স্ক্রিন রয়েছে যা ব্যবহারকারীদের তাদের ডেটা অ্যাক্সেসের অনুরোধকারী অ্যাপ্লিকেশন, তারা কী ধরনের ডেটা চাইছে এবং প্রযোজ্য শর্তাদি জানায়। একটি Google API ক্লায়েন্ট আইডি তৈরি করার আগে আপনাকে আপনার OAuth সম্মতি স্ক্রীন কনফিগার করতে হবে।
- Google APIs কনসোলের OAuth সম্মতি স্ক্রীন পৃষ্ঠা খুলুন।
- অনুরোধ করা হলে, আপনি এইমাত্র তৈরি করা প্রকল্পটি নির্বাচন করুন।
"OAuth সম্মতি স্ক্রীন" পৃষ্ঠায়, ফর্মটি পূরণ করুন এবং "সংরক্ষণ করুন" বোতামে ক্লিক করুন।
আবেদনের নাম: সম্মতি চাওয়া আবেদনের নাম। নামটি আপনার অ্যাপ্লিকেশনটিকে সঠিকভাবে প্রতিফলিত করতে হবে এবং ব্যবহারকারীরা অন্য কোথাও যে অ্যাপ্লিকেশনটি দেখেন তার সাথে সামঞ্জস্যপূর্ণ হওয়া উচিত। অ্যাকাউন্ট লিঙ্কিং সম্মতি স্ক্রিনে আবেদনের নাম দেখানো হবে।
অ্যাপ্লিকেশন লোগো: সম্মতি স্ক্রিনে একটি ছবি যা ব্যবহারকারীদের আপনার অ্যাপ চিনতে সাহায্য করবে। লোগোটি অ্যাকাউন্ট লিঙ্কিং সম্মতি স্ক্রিনে এবং অ্যাকাউন্ট সেটিংসে দেখানো হয়েছে
সমর্থন ইমেল: ব্যবহারকারীদের তাদের সম্মতি সম্পর্কে প্রশ্নগুলির সাথে আপনার সাথে যোগাযোগ করার জন্য।
Google API-এর জন্য স্কোপ: স্কোপগুলি আপনার অ্যাপ্লিকেশনকে আপনার ব্যবহারকারীর ব্যক্তিগত Google ডেটা অ্যাক্সেস করার অনুমতি দেয়। Google অ্যাকাউন্ট লিঙ্কিং ব্যবহারের ক্ষেত্রে, ডিফল্ট স্কোপ (ইমেল, প্রোফাইল, ওপেনআইডি) যথেষ্ট, আপনাকে কোনো সংবেদনশীল স্কোপ যোগ করতে হবে না। ক্রমবর্ধমানভাবে স্কোপের অনুরোধ করা একটি সর্বোত্তম অভ্যাস, যখন অ্যাক্সেসের প্রয়োজন হয়, সামনের পরিবর্তে। আরও জানুন
অনুমোদিত ডোমেন: আপনাকে এবং আপনার ব্যবহারকারীদের সুরক্ষিত রাখতে, Google শুধুমাত্র OAuth ব্যবহার করে প্রমাণীকৃত অ্যাপ্লিকেশনগুলিকে অনুমোদিত ডোমেন ব্যবহার করার অনুমতি দেয়। আপনার অ্যাপ্লিকেশনের লিঙ্কগুলি অবশ্যই অনুমোদিত ডোমেনে হোস্ট করা উচিত। আরও জানুন
অ্যাপ্লিকেশন হোমপেজ লিঙ্ক: আপনার আবেদনের জন্য হোম পেজ. একটি অনুমোদিত ডোমেনে হোস্ট করা আবশ্যক।
অ্যাপ্লিকেশন গোপনীয়তা নীতি লিঙ্ক: Google অ্যাকাউন্ট লিঙ্কিং সম্মতি স্ক্রিনে দেখানো হয়েছে। একটি অনুমোদিত ডোমেনে হোস্ট করা আবশ্যক।
পরিষেবার আবেদনের শর্তাবলী লিঙ্ক (ঐচ্ছিক): একটি অনুমোদিত ডোমেনে হোস্ট করা আবশ্যক।
চিত্র 1 । একটি কল্পিত অ্যাপ্লিকেশন, টিউনারির জন্য Google অ্যাকাউন্ট লিঙ্ক করার সম্মতি স্ক্রীন
"যাচাই স্থিতি" চেক করুন, যদি আপনার আবেদনের যাচাইকরণের প্রয়োজন হয় তাহলে যাচাইয়ের জন্য আপনার আবেদন জমা দিতে "যাচাইয়ের জন্য জমা দিন" বোতামে ক্লিক করুন। বিশদ বিবরণের জন্য OAuth যাচাইকরণের প্রয়োজনীয়তা পড়ুন।
আপনার OAuth সার্ভার বাস্তবায়ন করুন
An OAuth 2.0 server implementation of the authorization code flow consists of two endpoints, which your service makes available by HTTPS. The first endpoint is the authorization endpoint, which is responsible for finding or obtaining consent from users for data access. The authorization endpoint presents a sign-in UI to your users that aren't already signed in and records consent to the requested access. The second endpoint is the token exchange endpoint, which is used to obtain encrypted strings, called tokens, that authorize a user to access your service.
When a Google application needs to call one of your service's APIs, Google uses these endpoints together to get permission from your users to call these APIs on their behalf.
An OAuth 2.0 authorization code flow session initiated by Google has the following flow:
- Google opens your authorization endpoint in the user's browser. If the flow started on a voice-only device for an Action, Google transfers the execution to a phone.
- The user signs in, if not signed in already, and grants Google permission to access their data with your API, if they haven't already granted permission.
- Your service creates an authorization code and returns it to Google. To do so, redirect the user's browser back to Google with the authorization code attached to the request.
- Google sends the authorization code to your token exchange endpoint, which verifies the authenticity of the code and returns an access token and a refresh token. The access token is a short-lived token that your service accepts as credentials to access APIs. The refresh token is a long-lived token that Google can store and use to acquire new access tokens when they expire.
- After the user has completed the account linking flow, every subsequent request sent from Google contains an access token.
Handle authorization requests
When you need to perform account linking using the OAuth 2.0 authorization code flow, Google sends the user to your authorization endpoint with a request that includes the following parameters:
Authorization endpoint parameters | |
---|---|
client_id |
The Client ID you assigned to Google. |
redirect_uri |
The URL to which you send the response to this request. |
state |
A bookkeeping value that is passed back to Google unchanged in the redirect URI. |
scope |
Optional: A space-delimited set of scope strings that specify the data Google is requesting authorization for. |
response_type |
The type of value to return in the response. For the OAuth 2.0
authorization code flow, the response type is always code .
|
user_locale |
The Google Account language setting in RFC5646 format, used to localize your content in the user's preferred language. |
For example, if your authorization endpoint is available at
https://myservice.example.com/auth
, a request might look like the following:
GET https://myservice.example.com/auth?client_id=GOOGLE_CLIENT_ID&redirect_uri=REDIRECT_URI&state=STATE_STRING&scope=REQUESTED_SCOPES&response_type=code&user_locale=LOCALE
For your authorization endpoint to handle sign-in requests, do the following steps:
- Verify that the
client_id
matches the Client ID you assigned to Google, and that theredirect_uri
matches the redirect URL provided by Google for your service. These checks are important to prevent granting access to unintended or misconfigured client apps. If you support multiple OAuth 2.0 flows, also confirm that theresponse_type
iscode
. - Check if the user is signed in to your service. If the user isn't signed in, complete your service's sign-in or sign-up flow.
- Generate an authorization code for Google to use to access your API. The authorization code can be any string value, but it must uniquely represent the user, the client the token is for, and the code's expiration time, and it must not be guessable. You typically issue authorization codes that expire after approximately 10 minutes.
- Confirm that the URL specified by the
redirect_uri
parameter has the following form:https://oauth-redirect.googleusercontent.com/r/YOUR_PROJECT_ID https://oauth-redirect-sandbox.googleusercontent.com/r/YOUR_PROJECT_ID
- Redirect the user's browser to the URL specified by the
redirect_uri
parameter. Include the authorization code you just generated and the original, unmodified state value when you redirect by appending thecode
andstate
parameters. The following is an example of the resulting URL:https://oauth-redirect.googleusercontent.com/r/YOUR_PROJECT_ID?code=AUTHORIZATION_CODE&state=STATE_STRING
Handle token exchange requests
Your service's token exchange endpoint is responsible for two kinds of token exchanges:
- Exchange authorization codes for access tokens and refresh tokens
- Exchange refresh tokens for access tokens
Token exchange requests include the following parameters:
Token exchange endpoint parameters | |
---|---|
client_id |
A string that identifies the request origin as Google. This string must be registered within your system as Google's unique identifier. |
client_secret |
A secret string that you registered with Google for your service. |
grant_type |
The type of token being exchanged. It's either
authorization_code or refresh_token . |
code |
When grant_type=authorization_code , this parameter is the
code Google received from either your sign-in or token exchange
endpoint. |
redirect_uri |
When grant_type=authorization_code , this parameter is the
URL used in the initial authorization request. |
refresh_token |
When grant_type=refresh_token , this parameter is the
refresh token Google received from your token exchange endpoint. |
Exchange authorization codes for access tokens and refresh tokens
After the user signs in and your authorization endpoint returns a short-lived authorization code to Google, Google sends a request to your token exchange endpoint to exchange the authorization code for an access token and a refresh token.
For these requests, the value of grant_type
is authorization_code
, and the
value of code
is the value of the authorization code you previously granted
to Google. The following is an example of a request to exchange an
authorization code for an access token and a refresh token:
POST /token HTTP/1.1 Host: oauth2.example.com Content-Type: application/x-www-form-urlencoded client_id=GOOGLE_CLIENT_ID&client_secret=GOOGLE_CLIENT_SECRET&grant_type=authorization_code&code=AUTHORIZATION_CODE&redirect_uri=REDIRECT_URI
To exchange authorization codes for an access token and a refresh token, your
token exchange endpoint responds to POST
requests by executing the following
steps:
- Verify that the
client_id
identifies the request origin as an authorized origin, and that theclient_secret
matches the expected value. - Verify that the authorization code is valid and not expired, and that the client ID specified in the request matches the client ID associated with the authorization code.
- Confirm that the URL specified by the
redirect_uri
parameter is identical to the value used in the initial authorization request. - If you can't verify all of the above criteria, return an HTTP
400 Bad Request error with
{"error": "invalid_grant"}
as the body. - Otherwise, use the user ID from the authorization code to generate a refresh token and an access token. These tokens can be any string value, but they must uniquely represent the user and the client the token is for, and they must not be guessable. For access tokens, also record the expiration time of the token, which is typically an hour after you issue the token. Refresh tokens don't expire.
- Return the following JSON object in the body of the HTTPS response:
{ "token_type": "Bearer", "access_token": "ACCESS_TOKEN", "refresh_token": "REFRESH_TOKEN", "expires_in": SECONDS_TO_EXPIRATION }
Google stores the access token and the refresh token for the user and records the expiration of the access token. When the access token expires, Google uses the refresh token to get a new access token from your token exchange endpoint.
Exchange refresh tokens for access tokens
When an access token expires, Google sends a request to your token exchange endpoint to exchange a refresh token for a new access token.
For these requests, the value of grant_type
is refresh_token
, and the value
of refresh_token
is the value of the refresh token you previously granted to
Google. The following is an example of a request to exchange a refresh token
for an access token:
POST /token HTTP/1.1 Host: oauth2.example.com Content-Type: application/x-www-form-urlencoded client_id=GOOGLE_CLIENT_ID&client_secret=GOOGLE_CLIENT_SECRET&grant_type=refresh_token&refresh_token=REFRESH_TOKEN
To exchange a refresh token for an access token, your token exchange endpoint
responds to POST
requests by executing the following steps:
- Verify that the
client_id
identifies the request origin as Google, and that theclient_secret
matches the expected value. - Verify that the refresh token is valid, and that the client ID specified in the request matches the client ID associated with the refresh token.
- If you can't verify all of the above criteria, return an HTTP 400
Bad Request error with
{"error": "invalid_grant"}
as the body. - Otherwise, use the user ID from the refresh token to generate an access token. These tokens can be any string value, but they must uniquely represent the user and the client the token is for, and they must not be guessable. For access tokens, also record the expiration time of the token, typically an hour after you issue the token.
- Return the following JSON object in the body of the HTTPS
response:
{ "token_type": "Bearer", "access_token": "ACCESS_TOKEN", "expires_in": SECONDS_TO_EXPIRATION }
ব্যবহারকারীর তথ্যের অনুরোধগুলি পরিচালনা করুন
Userinfo শেষবিন্দু একটি OAuth 2.0 সংরক্ষিত সম্পদ যে লিঙ্ক ব্যবহারকারী সম্পর্কে রিটার্ন দাবী। ইউজার ইনফো এন্ডপয়েন্ট বাস্তবায়ন এবং হোস্ট করা ঐচ্ছিক, নিম্নলিখিত ব্যবহারের ক্ষেত্রে ছাড়া:
- অ্যাকাউন্ট সাইন-ইন লিঙ্কড গুগল একবার আলতো চাপ।
- Frictionless সাবস্ক্রিপশন AndroidTV 'উপর।
আপনার টোকেন এন্ডপয়েন্ট থেকে অ্যাক্সেস টোকেন সফলভাবে পুনরুদ্ধার করার পরে, Google লিঙ্ক করা ব্যবহারকারীর সম্পর্কে প্রাথমিক প্রোফাইল তথ্য পুনরুদ্ধার করার জন্য আপনার ব্যবহারকারীর তথ্য এন্ডপয়েন্টে একটি অনুরোধ পাঠায়।
userinfo এন্ডপয়েন্ট রিকোয়েস্ট হেডার | |
---|---|
Authorization header | টাইপ বিয়ারারের অ্যাক্সেস টোকেন। |
উদাহরণস্বরূপ, যদি আপনার userinfo শেষবিন্দু পাওয়া যাবে https://myservice.example.com/userinfo
একটি অনুরোধ নিম্নলিখিত অনুযায়ী প্রদর্শিত হবে:
GET /userinfo HTTP/1.1 Host: myservice.example.com Authorization: Bearer ACCESS_TOKEN
অনুরোধগুলি পরিচালনা করার জন্য আপনার ব্যবহারকারীর তথ্যের শেষ পয়েন্টের জন্য, নিম্নলিখিত পদক্ষেপগুলি করুন:
- অনুমোদন শিরোনাম থেকে অ্যাক্সেস টোকেন বের করুন এবং অ্যাক্সেস টোকেনের সাথে যুক্ত ব্যবহারকারীর জন্য তথ্য ফেরত দিন।
- তাহলে অ্যাক্সেস টোকেন অবৈধ, ব্যবহারে কোন HTTP 401 অননুমোদিত ত্রুটি আসতে
WWW-Authenticate
প্রতিক্রিয়া শীর্ষক। নীচে একটি userinfo ত্রুটি প্রতিক্রিয়া একটি উদাহরণ:HTTP/1.1 401 Unauthorized WWW-Authenticate: error="invalid_token", error_description="The Access Token expired"
যদি একটি 401 অননুমোদিত, বা অন্য কোন অসফল ত্রুটি প্রতিক্রিয়া লিঙ্ক প্রক্রিয়ার সময় ফিরিয়ে দেওয়া হয়, ত্রুটি অ আদায়যোগ্য হবে পুনরুদ্ধারকৃত টোকেন বাতিল করা হবে এবং ব্যবহারকারী থাকবে আবার লিঙ্কিং প্রক্রিয়া শুরু করতে। অ্যাক্সেস টোকেন বৈধ, রিটার্ন ও HTTP 200 HTTPS দ্বারা প্রতিক্রিয়া দেহের নিম্নলিখিত JSON বস্তু সঙ্গে প্রতিক্রিয়া এমন:
{ "sub": "USER_UUID", "email": "EMAIL_ADDRESS", "given_name": "FIRST_NAME", "family_name": "LAST_NAME", "name": "FULL_NAME", "picture": "PROFILE_PICTURE", }
আপনার userinfo শেষবিন্দু আয় একটি HTTP 200 সাফল্য প্রতিক্রিয়া পারেন, টোকেন উদ্ধার এবং দাবী ব্যবহারকারীর গুগলের বিরুদ্ধে নিবন্ধিত অ্যাকাউন্টব্যবহারকারীর তথ্য শেষ পয়েন্ট প্রতিক্রিয়া sub
একটি অনন্য আইডি যা আপনার সিস্টেমে ব্যবহারকারীকে শনাক্ত করে। email
ব্যবহারকারীর ইমেল ঠিকানা। given_name
ঐচ্ছিক: ব্যবহারকারী প্রথম নাম। family_name
ঐচ্ছিক: ব্যবহারকারীর শেষ নাম। name
ঐচ্ছিক: ব্যবহারকারীর সম্পূর্ণ নাম। picture
ঐচ্ছিক: ব্যবহারকারীর প্রোফাইল ছবি।
আপনার বাস্তবায়ন যাচাই করা হচ্ছে
আপনি ব্যবহার করে আপনার বাস্তবায়ন যাচাই করতে পারেন OAuth এর 2.0 খেলার মাঠ হাতিয়ার।
সরঞ্জামটিতে, নিম্নলিখিত পদক্ষেপগুলি করুন:
- কনফিগারেশন ক্লিক করুন OAuth এর 2.0 কনফিগারেশন উইন্ডোটি বন্ধ করুন।
- OAuth এর প্রবাহ ক্ষেত্রে, ক্লায়েন্ট-সাইড নির্বাচন করুন।
- OAuth এর এন্ডপয়েন্ট ক্ষেত্রে, কাস্টম নির্বাচন করুন।
- সংশ্লিষ্ট ক্ষেত্রগুলিতে আপনার OAuth 2.0 এন্ডপয়েন্ট এবং Google- কে আপনার দেওয়া ক্লায়েন্ট আইডি উল্লেখ করুন।
- ধাপ 1 বিভাগে, যেকোনো Google সুযোগ নির্বাচন করবেন না। পরিবর্তে, এই ক্ষেত্রটি ফাঁকা রাখুন অথবা আপনার সার্ভারের জন্য বৈধ একটি সুযোগ টাইপ করুন (অথবা যদি আপনি OAuth স্কোপ ব্যবহার না করেন তবে একটি নির্বিচারে স্ট্রিং)। আপনার হয়ে গেলে, অনুমোদন API গুলি ক্লিক করুন।
- ধাপ 2 এবং 3 য় ধাপ বিভাগগুলিতে, OAuth এর 2.0 প্রবাহ মধ্য দিয়ে যেতে এবং যাচাই করুন যে প্রতিটি পদক্ষেপ হিসাবে উদ্দীষ্ট কাজ করে।
আপনি ব্যবহার করে আপনার বাস্তবায়ন যাচাই করতে পারেন Google অ্যাকাউন্টের সাথে লিঙ্ক ডেমো হাতিয়ার।
সরঞ্জামটিতে, নিম্নলিখিত পদক্ষেপগুলি করুন:
- ক্লিক Google বাটন সঙ্গে সাইন-ইন।
- আপনি যে অ্যাকাউন্টটি লিঙ্ক করতে চান তা চয়ন করুন।
- পরিষেবা আইডি লিখুন।
- Allyচ্ছিকভাবে এক বা একাধিক ক্ষেত্র লিখুন যার জন্য আপনি অ্যাক্সেসের অনুরোধ করবেন।
- স্টার্ট ডেমো ক্লিক করুন।
- যখন অনুরোধ করা হবে, নিশ্চিত করুন যে আপনি সম্মতি দিতে পারেন এবং লিঙ্কিং অনুরোধটি অস্বীকার করতে পারেন।
- নিশ্চিত করুন যে আপনি আপনার প্ল্যাটফর্মে পুনirectনির্দেশিত হয়েছেন।