OAuth और 'Google साइन इन' के साथ व्यवस्थित लिंक करना

खास जानकारी

OAuth पर आधारित 'Google साइन इन' को बेहतर तरीके से लिंक करने की सुविधा में, OAuth लिंकिंग के सबसे ऊपर Google साइन इन की सुविधा जोड़ी जाती है. इससे Google उपयोगकर्ताओं को बिना किसी रुकावट के अनुभव मिलता है. साथ ही, इससे खाता भी बनाया जा सकता है, जिससे उपयोगकर्ता अपने Google खाते का इस्तेमाल करके आपकी सेवा पर एक नया खाता बना सकते हैं.

OAuth और Google साइन इन के साथ खाता जोड़ने के लिए, यह सामान्य तरीका अपनाएं:

  1. सबसे पहले, उपयोगकर्ता से अपनी Google प्रोफ़ाइल ऐक्सेस करने की सहमति दें.
  2. यह देखने के लिए कि उपयोगकर्ता खाता मौजूद है या नहीं, उनकी प्रोफ़ाइल में दी गई जानकारी का इस्तेमाल करें.
  3. मौजूदा उपयोगकर्ताओं के लिए, खाते लिंक करें.
  4. अगर आपको पुष्टि करने वाले सिस्टम में, Google उपयोगकर्ता का कोई मिलान नहीं मिल रहा है, तो Google से मिले आईडी टोकन की पुष्टि करें. फिर आप आईडी टोकन में मौजूद प्रोफ़ाइल की जानकारी के आधार पर उपयोगकर्ता बना सकते हैं.
यह डायग्राम, उपयोगकर्ता को अपने Google खाते को लिंक करने के चरण दिखाता है. इसके लिए, खाता जोड़ने के व्यवस्थित फ़्लो का इस्तेमाल किया जाता है. पहले स्क्रीनशॉट में बताया गया है कि कोई उपयोगकर्ता, लिंक करने के लिए आपके ऐप्लिकेशन को कैसे चुन सकता है. दूसरे स्क्रीनशॉट से उपयोगकर्ता को यह पुष्टि करने में मदद मिलती है कि आपकी सेवा पर कोई मौजूदा खाता है या नहीं. तीसरा स्क्रीनशॉट, उपयोगकर्ता को वह Google खाता चुनने की सुविधा देता है जिससे उसे लिंक करना है. चौथे स्क्रीनशॉट में, Google खाते को आपके ऐप्लिकेशन से जोड़ने की पुष्टि दिखाई गई है. पांचवां स्क्रीनशॉट, Google app में लिंक किए गए उपयोगकर्ता खाते को दिखाता है.

पहली इमेज. व्यवस्थित लिंकिंग के साथ उपयोगकर्ता के फ़ोन पर खाता लिंक करना

व्यवस्थित तरीके से लिंक करने से जुड़ी ज़रूरी शर्तें

  • सामान्य वेब OAuth लिंकिंग फ़्लो लागू करें. आपकी सेवा में, OAuth 2.0 का पालन करने वाली अनुमति और टोकन एक्सचेंज एंडपॉइंट काम करने चाहिए.
  • आपके टोकन एक्सचेंज एंडपॉइंट को, JSON वेब टोकन (JWT) दावों के साथ काम करना चाहिए. साथ ही, check, create, और get इंटेंट को लागू करना चाहिए.

अपना OAuth सर्वर लागू करें

आपके टोकन एक्सचेंज एंडपॉइंट को check, create, और get इंटेंट के साथ काम करना चाहिए. नीचे, खाता जोड़ने के फ़्लो से जुड़े चरण दिखाए गए हैं. साथ ही, यह भी बताता है कि अलग-अलग इंटेंट को कब कॉल किया जाता है:

  1. क्या उपयोगकर्ता के पास आपके प्रमाणीकरण सिस्टम में खाता है? (उपयोगकर्ता 'हां' या 'नहीं' चुनकर तय करता है)
    1. हां : क्या उपयोगकर्ता आपके प्लैटफ़ॉर्म में साइन इन करने के लिए, अपने Google खाते से जुड़े ईमेल पते का इस्तेमाल करता है? (उपयोगकर्ता 'हां' या 'नहीं' चुनकर तय करता है)
      1. हां : क्या उपयोगकर्ता के पास आपके पुष्टि करने वाले सिस्टम में कोई मिलता-जुलता खाता है? (check intent को पुष्टि करने के लिए कॉल किया जाता है)
        1. हां : get intent को कॉल किया जाता है. अगर इंटेंट वापस मिल जाता है, तो खाता जोड़ दिया जाता है.
        2. NO : नया खाता बनाएं? (उपयोगकर्ता 'हां' या 'नहीं' चुनकर तय करता है)
          1. हां : create intent को कॉल किया जाता है. अगर इंटेंट बनाया जाता है, तो खाता लिंक हो जाता है.
          2. नहीं : वेब OAuth फ़्लो ट्रिगर हो जाता है, उपयोगकर्ता को उनके ब्राउज़र पर भेज दिया जाता है और उपयोगकर्ता को किसी दूसरे ईमेल से लिंक करने का विकल्प दिया जाता है.
      2. नहीं : वेब OAuth फ़्लो ट्रिगर हो जाता है, उपयोगकर्ता को उनके ब्राउज़र पर भेज दिया जाता है और उपयोगकर्ता को किसी दूसरे ईमेल से लिंक करने का विकल्प दिया जाता है.
    2. नहीं : क्या उपयोगकर्ता के पास आपके पुष्टि करने वाले सिस्टम में कोई मिलता-जुलता खाता है? (check intent को पुष्टि करने के लिए कॉल किया जाता है)
      1. हां : get intent को कॉल किया जाता है. अगर इंटेंट वापस मिल जाता है, तो खाता जोड़ दिया जाता है.
      2. नहीं : create intent को कॉल किया जाता है और अगर खाता बनाने की प्रोसेस पूरी हो जाती है, तो खाता जोड़ दिया जाता है.

मौजूदा उपयोगकर्ता खाते की जांच करना (इंटेंट देखना)

जब उपयोगकर्ता अपनी Google प्रोफ़ाइल को ऐक्सेस करने की सहमति देता है, तब Google ऐसा अनुरोध भेजता है जिसमें Google के उपयोगकर्ता की पहचान पर हस्ताक्षर किया गया हो. दावे में जानकारी शामिल है, जिसमें उपयोगकर्ता का #Google खाता आईडी, नाम, और ईमेल पता शामिल है. आपके प्रोजेक्ट के लिए कॉन्फ़िगर किया गया टोकन एक्सचेंज एंडपॉइंट, उस अनुरोध को हैंडल करता है.

अगर आपके पुष्टि करने वाले सिस्टम में इससे जुड़ा Google खाता पहले से मौजूद है, तो आपका टोकन एक्सचेंज एंडपॉइंट, account_found=true के साथ जवाब देता है. अगर Google खाते का मिलान किसी मौजूदा उपयोगकर्ता से नहीं होता है, तो आपका टोकन एक्सचेंज एंडपॉइंट, account_found=false के साथ एचटीटीपी 404 नहीं मिला की गड़बड़ी दिखाता है.

अनुरोध में यह फ़ॉर्म शामिल होना चाहिए:

POST /token HTTP/1.1
Host: oauth2.example.com
Content-Type: application/x-www-form-urlencoded

grant_type=urn:ietf:params:oauth:grant-type:jwt-bearer&intent=check&assertion=JWT&scope=SCOPES&client_id=GOOGLE_CLIENT_ID&client_secret=GOOGLE_CLIENT_SECRET

आपका टोकन एक्सचेंज एंडपॉइंट इन पैरामीटर को मैनेज कर सकता है:

टोकन एंडपॉइंट पैरामीटर
intent इन अनुरोधों के लिए, इस पैरामीटर की वैल्यू check है.
grant_type एक्सचेंज किए जा रहे टोकन का टाइप. इन अनुरोधों के लिए, इस पैरामीटर की वैल्यू urn:ietf:params:oauth:grant-type:jwt-bearer है.
assertion JSON वेब टोकन (JWT) जो Google उपयोगकर्ता की पहचान की पुष्टि करता है. JWT में उपयोगकर्ता का ईमेल पता, नाम, और ईमेल पते की जानकारी शामिल होती है.
client_id Google को असाइन किया गया क्लाइंट आईडी.
client_secret वह क्लाइंट सीक्रेट जो आपने Google को असाइन किया है.

check इंटेंट अनुरोधों का जवाब देने के लिए, आपके टोकन एक्सचेंज एंडपॉइंट को नीचे दिए गए तरीके को अपनाना होगा:

  • JWT दावे की पुष्टि करें और उसे डिकोड करें.
  • पक्का करें कि आपके पुष्टि करने वाले सिस्टम में Google खाता पहले से मौजूद है या नहीं.
Validate and decode the JWT assertion

You can validate and decode the JWT assertion by using a JWT-decoding library for your language. Use Google's public keys, available in JWK or PEM formats, to verify the token's signature.

When decoded, the JWT assertion looks like the following example:

{
  "sub": "1234567890",      // The unique ID of the user's Google Account
  "iss": "https://accounts.google.com",        // The assertion's issuer
  "aud": "123-abc.apps.googleusercontent.com", // Your server's client ID
  "iat": 233366400,         // Unix timestamp of the assertion's creation time
  "exp": 233370000,         // Unix timestamp of the assertion's expiration time
  "name": "Jan Jansen",
  "given_name": "Jan",
  "family_name": "Jansen",
  "email": "jan@gmail.com", // If present, the user's email address
  "email_verified": true,   // true, if Google has verified the email address
  "hd": "example.com",      // If present, the host domain of the user's GSuite email address
                            // If present, a URL to user's profile picture
  "picture": "https://lh3.googleusercontent.com/a-/AOh14GjlTnZKHAeb94A-FmEbwZv7uJD986VOF1mJGb2YYQ",
  "locale": "en_US"         // User's locale, from browser or phone settings
}

In addition to verifying the token's signature, verify that the assertion's issuer (iss field) is https://accounts.google.com, that the audience (aud field) is your assigned client ID, and that the token has not expired (exp field).

Using the email, email_verified and hd fields you can determine if Google hosts and is authoritative for an email address. In cases where Google is authoritative the user is currently known to be the legitimate account owner and you may skip password or other challenges methods. Otherwise, these methods can be used to verify the account prior to linking.

Cases where Google is authoritative:

  • email has a @gmail.com suffix, this is a Gmail account.
  • email_verified is true and hd is set, this is a G Suite account.

Users may register for Google Accounts without using Gmail or G Suite. When email does not contain a @gmail.com suffix and hd is absent Google is not authoritative and password or other challenge methods are recommended to verify the user. email_verfied can also be true as Google initially verified the user when the Google account was created, however ownership of the third party email account may have since changed.

पुष्टि करने वाला Google खाता पहले से मौजूद है या नहीं, इसकी जांच करना

देखें कि इनमें से कोई एक शर्त सही है या नहीं:

  • दावा और #39; sub फ़ील्ड में मिला Google खाता आईडी, आपके उपयोगकर्ता के डेटाबेस में है.
  • दावे में मौजूद ईमेल पता, आपके उपयोगकर्ता डेटाबेस के उपयोगकर्ता से मेल खाता है.

अगर दोनों में से कोई भी शर्त सही है, तो इसका मतलब है कि उपयोगकर्ता पहले ही साइन अप कर चुका है. इस स्थिति में, कोई जवाब इस तरह दें:

HTTP/1.1 200 Success
Content-Type: application/json;charset=UTF-8

{
  "account_found":"true",
}

अगर दावा करने के दौरान दिया गया ईमेल पता और Google खाता, आपके डेटाबेस के उपयोगकर्ता से मेल नहीं खाता है, तो इसका मतलब है कि उपयोगकर्ता ने अभी तक साइन अप नहीं किया है. इस मामले में, आपके टोकन एक्सचेंज एंडपॉइंट को एचटीटीपी 404 गड़बड़ी के साथ जवाब देना ज़रूरी है, जो "account_found": "false" के बारे में बताता है, जैसा कि नीचे दिए गए उदाहरण में बताया है:

HTTP/1.1 404 Not found
Content-Type: application/json;charset=UTF-8

{
  "account_found":"false",
}

ऑटोमैटिक लिंकिंग (इंटेंट)

जब उपयोगकर्ता अपनी Google प्रोफ़ाइल को ऐक्सेस करने की सहमति देता है, तब Google ऐसा अनुरोध भेजता है जिसमें Google के उपयोगकर्ता की पहचान पर हस्ताक्षर किया गया हो. दावे में जानकारी शामिल है, जिसमें उपयोगकर्ता का #Google खाता आईडी, नाम, और ईमेल पता शामिल है. आपके प्रोजेक्ट के लिए कॉन्फ़िगर किया गया टोकन एक्सचेंज एंडपॉइंट, उस अनुरोध को हैंडल करता है.

अगर आपके पुष्टि करने वाले सिस्टम में इससे जुड़ा Google खाता पहले से मौजूद है, तो आपका टोकन एक्सचेंज एंडपॉइंट, उपयोगकर्ता के लिए टोकन दिखाता है. अगर Google खाता किसी मौजूदा उपयोगकर्ता से मेल नहीं खाता है, तो आपका टोकन एक्सचेंज एंडपॉइंट linking_errorगड़बड़ी और वैकल्पिक login_hint दिखाता है.

अनुरोध में यह फ़ॉर्म शामिल होना चाहिए:

POST /token HTTP/1.1
Host: oauth2.example.com
Content-Type: application/x-www-form-urlencoded

grant_type=urn:ietf:params:oauth:grant-type:jwt-bearer&intent=get&assertion=JWT&scope=SCOPES&client_id=GOOGLE_CLIENT_ID&client_secret=GOOGLE_CLIENT_SECRET

आपका टोकन एक्सचेंज एंडपॉइंट इन पैरामीटर को मैनेज कर सकता है:

टोकन एंडपॉइंट पैरामीटर
intent इन अनुरोधों के लिए, इस पैरामीटर की वैल्यू get है.
grant_type एक्सचेंज किए जा रहे टोकन का टाइप. इन अनुरोधों के लिए, इस पैरामीटर की वैल्यू urn:ietf:params:oauth:grant-type:jwt-bearer है.
assertion JSON वेब टोकन (JWT) जो Google उपयोगकर्ता की पहचान की पुष्टि करता है. JWT में उपयोगकर्ता का ईमेल पता, नाम, और ईमेल पते की जानकारी शामिल होती है.
scope ज़रूरी नहीं: ऐसा कोई भी स्कोप जिसके तहत आपने उपयोगकर्ताओं के अनुरोध के लिए, Google को कॉन्फ़िगर किया है.
client_id Google को असाइन किया गया क्लाइंट आईडी.
client_secret वह क्लाइंट सीक्रेट जो आपने Google को असाइन किया है.

get इंटेंट अनुरोधों का जवाब देने के लिए, आपके टोकन एक्सचेंज एंडपॉइंट को नीचे दिए गए तरीके को अपनाना होगा:

  • JWT दावे की पुष्टि करें और उसे डिकोड करें.
  • पक्का करें कि आपके पुष्टि करने वाले सिस्टम में Google खाता पहले से मौजूद है या नहीं.
Validate and decode the JWT assertion

You can validate and decode the JWT assertion by using a JWT-decoding library for your language. Use Google's public keys, available in JWK or PEM formats, to verify the token's signature.

When decoded, the JWT assertion looks like the following example:

{
  "sub": "1234567890",      // The unique ID of the user's Google Account
  "iss": "https://accounts.google.com",        // The assertion's issuer
  "aud": "123-abc.apps.googleusercontent.com", // Your server's client ID
  "iat": 233366400,         // Unix timestamp of the assertion's creation time
  "exp": 233370000,         // Unix timestamp of the assertion's expiration time
  "name": "Jan Jansen",
  "given_name": "Jan",
  "family_name": "Jansen",
  "email": "jan@gmail.com", // If present, the user's email address
  "email_verified": true,   // true, if Google has verified the email address
  "hd": "example.com",      // If present, the host domain of the user's GSuite email address
                            // If present, a URL to user's profile picture
  "picture": "https://lh3.googleusercontent.com/a-/AOh14GjlTnZKHAeb94A-FmEbwZv7uJD986VOF1mJGb2YYQ",
  "locale": "en_US"         // User's locale, from browser or phone settings
}

In addition to verifying the token's signature, verify that the assertion's issuer (iss field) is https://accounts.google.com, that the audience (aud field) is your assigned client ID, and that the token has not expired (exp field).

Using the email, email_verified and hd fields you can determine if Google hosts and is authoritative for an email address. In cases where Google is authoritative the user is currently known to be the legitimate account owner and you may skip password or other challenges methods. Otherwise, these methods can be used to verify the account prior to linking.

Cases where Google is authoritative:

  • email has a @gmail.com suffix, this is a Gmail account.
  • email_verified is true and hd is set, this is a G Suite account.

Users may register for Google Accounts without using Gmail or G Suite. When email does not contain a @gmail.com suffix and hd is absent Google is not authoritative and password or other challenge methods are recommended to verify the user. email_verfied can also be true as Google initially verified the user when the Google account was created, however ownership of the third party email account may have since changed.

पुष्टि करने वाला Google खाता पहले से मौजूद है या नहीं, इसकी जांच करना

देखें कि इनमें से कोई एक शर्त सही है या नहीं:

  • दावा और #39; sub फ़ील्ड में मिला Google खाता आईडी, आपके उपयोगकर्ता के डेटाबेस में है.
  • दावे में मौजूद ईमेल पता, आपके उपयोगकर्ता डेटाबेस के उपयोगकर्ता से मेल खाता है.

अगर उपयोगकर्ता के लिए कोई खाता मौजूद है, तो ऐक्सेस टोकन जारी करें और JSON ऑब्जेक्ट में अपने एचटीटीपीएस रिस्पॉन्स के मुख्य हिस्से में वैल्यू दिखाएं, जैसे कि नीचे दिया गया उदाहरण:

{
  "token_type": "Bearer",
  "access_token": "ACCESS_TOKEN",

  "refresh_token": "REFRESH_TOKEN",

  "expires_in": SECONDS_TO_EXPIRATION
}

कुछ मामलों में, आईडी टोकन के आधार पर खाता जोड़ना उपयोगकर्ता के लिए काम नहीं कर सकता. अगर ऐसा किसी भी वजह से होता है, तो आपके टोकन एक्सचेंज एंडपॉइंट को एचटीटीपी 401 की गड़बड़ी के साथ जवाब देना होगा, जो error=linking_error के बारे में बताता है. नीचे दिया गया उदाहरण देखें:

HTTP/1.1 401 Unauthorized
Content-Type: application/json;charset=UTF-8

{
  "error":"linking_error",
  "login_hint":"foo@bar.com"
}

जब Google को linking_error के साथ 401 गड़बड़ी का जवाब मिलता है, तो Google उपयोगकर्ता को login_hint के साथ आपके ऑथराइज़ेशन एंडपॉइंट पर पैरामीटर के तौर पर भेजता है. उपयोगकर्ता, अपने ब्राउज़र में OAuth लिंकिंग फ़्लो का इस्तेमाल करके खाता लिंक करने की प्रक्रिया पूरी करता है.

Handle account creation via Google Sign-In (create intent)

When a user needs to create an account on your service, Google makes a request to your token exchange endpoint that specifies intent=create.

The request has the following form:

POST /token HTTP/1.1
Host: oauth2.example.com
Content-Type: application/x-www-form-urlencoded

response_type=token&grant_type=urn:ietf:params:oauth:grant-type:jwt-bearer&scope=SCOPES&intent=create&assertion=JWT&client_id=GOOGLE_CLIENT_ID&client_secret=GOOGLE_CLIENT_SECRET

Your token exchange endpoint must able to handle the following parameters:

Token endpoint parameters
intent For these requests, the value of this parameter is create.
grant_type The type of token being exchanged. For these requests, this parameter has the value urn:ietf:params:oauth:grant-type:jwt-bearer.
assertion A JSON Web Token (JWT) that provides a signed assertion of the Google user's identity. The JWT contains information that includes the user's Google Account ID, name, and email address.
client_id The client ID you assigned to Google.
client_secret The client secret you assigned to Google.

The JWT within the assertion parameter contains the user's Google Account ID, name, and email address, which you can use to create a new account on your service.

To respond to the create intent requests, your token exchange endpoint must perform the following steps:

  • Validate and decode the JWT assertion.
  • Validate user information and create new account.
Validate and decode the JWT assertion

You can validate and decode the JWT assertion by using a JWT-decoding library for your language. Use Google's public keys, available in JWK or PEM formats, to verify the token's signature.

When decoded, the JWT assertion looks like the following example:

{
  "sub": "1234567890",      // The unique ID of the user's Google Account
  "iss": "https://accounts.google.com",        // The assertion's issuer
  "aud": "123-abc.apps.googleusercontent.com", // Your server's client ID
  "iat": 233366400,         // Unix timestamp of the assertion's creation time
  "exp": 233370000,         // Unix timestamp of the assertion's expiration time
  "name": "Jan Jansen",
  "given_name": "Jan",
  "family_name": "Jansen",
  "email": "jan@gmail.com", // If present, the user's email address
  "email_verified": true,   // true, if Google has verified the email address
  "hd": "example.com",      // If present, the host domain of the user's GSuite email address
                            // If present, a URL to user's profile picture
  "picture": "https://lh3.googleusercontent.com/a-/AOh14GjlTnZKHAeb94A-FmEbwZv7uJD986VOF1mJGb2YYQ",
  "locale": "en_US"         // User's locale, from browser or phone settings
}

In addition to verifying the token's signature, verify that the assertion's issuer (iss field) is https://accounts.google.com, that the audience (aud field) is your assigned client ID, and that the token has not expired (exp field).

Using the email, email_verified and hd fields you can determine if Google hosts and is authoritative for an email address. In cases where Google is authoritative the user is currently known to be the legitimate account owner and you may skip password or other challenges methods. Otherwise, these methods can be used to verify the account prior to linking.

Cases where Google is authoritative:

  • email has a @gmail.com suffix, this is a Gmail account.
  • email_verified is true and hd is set, this is a G Suite account.

Users may register for Google Accounts without using Gmail or G Suite. When email does not contain a @gmail.com suffix and hd is absent Google is not authoritative and password or other challenge methods are recommended to verify the user. email_verfied can also be true as Google initially verified the user when the Google account was created, however ownership of the third party email account may have since changed.

Validate user information and create new account

Check whether either of the following conditions are true:

  • The Google Account ID, found in the assertion's sub field, is in your user database.
  • The email address in the assertion matches a user in your user database.

If either condition is true, prompt the user to link their existing account with their Google Account. To do so, respond to the request with an HTTP 401 error that specifies error=linking_error and gives the user's email address as the login_hint. The following is a sample response:

HTTP/1.1 401 Unauthorized
Content-Type: application/json;charset=UTF-8

{
  "error":"linking_error",
  "login_hint":"foo@bar.com"
}

When Google receives a 401 error response with linking_error, Google sends the user to your authorization endpoint with login_hint as a parameter. The user completes account linking using the OAuth linking flow in their browser.

If neither condition is true, create a new user account with the information provided in the JWT. New accounts don't typically have a password set. It's recommended that you add Google Sign-In to other platforms to enable users to log in with Google across the surfaces of your application. Alternatively, you can email the user a link that starts your password recovery flow to allow the user to set a password to sign in on other platforms.

When the creation is completed, issue an access token and refresh token and return the values in a JSON object in the body of your HTTPS response, like in the following example:

{
  "token_type": "Bearer",
  "access_token": "ACCESS_TOKEN",

  "refresh_token": "REFRESH_TOKEN",

  "expires_in": SECONDS_TO_EXPIRATION
}

अपना Google API क्लाइंट आईडी पाना

खाता जोड़ने की रजिस्ट्रेशन प्रक्रिया के दौरान, आपको अपना Google API क्लाइंट आईडी देना होगा.

OAuth लिंकिंग के चरणों को पूरा करते समय, आपने जो प्रोजेक्ट बनाया है उसका इस्तेमाल करके, अपना एपीआई क्लाइंट आईडी पाने के लिए. ऐसा करने के लिए, यह तरीका अपनाएं:

  1. Google API (एपीआई) कंसोल के क्रेडेंशियल पेज खोलें.
  2. कोई Google API प्रोजेक्ट बनाएं या चुनें.

    अगर आपके प्रोजेक्ट में वेब ऐप्लिकेशन के लिए क्लाइंट आईडी नहीं है, तो क्रेडेंशियल बनाएं और gt; OAuth क्लाइंट आईडी पर क्लिक करें. अनुमति वाले JavaScript ऑरिजिन बॉक्स में, अपनी साइट के डोमेन को शामिल करना न भूलें. लोकल टेस्ट या डेवलपमेंट करते समय, आपको http://localhost और http://localhost:<port_number>, दोनों को अनुमति वाले JavaScript ऑरिजिन फ़ील्ड में जोड़ना होगा.

लागू करने की पुष्टि की जा रही है

आप का उपयोग करके अपने कार्यान्वयन को मान्य कर सकते OAuth 2.0 खेल का मैदान उपकरण।

टूल में, निम्न चरणों का पालन करें:

  1. कॉन्फ़िगरेशन क्लिक करें OAuth 2.0 विन्यास विंडो खोलने के लिए।
  2. OAuth प्रवाह क्षेत्र में, क्लाइंट-साइड का चयन करें।
  3. OAuth Endpoints क्षेत्र में, कस्टम का चयन करें।
  4. अपना OAuth 2.0 समापन बिंदु और संबंधित फ़ील्ड में आपके द्वारा Google को निर्दिष्ट क्लाइंट आईडी निर्दिष्ट करें।
  5. चरण 1 अनुभाग में, किसी भी गूगल कार्यक्षेत्रों का चयन नहीं करते। इसके बजाय, इस फ़ील्ड को खाली छोड़ दें या अपने सर्वर के लिए मान्य दायरा टाइप करें (या यदि आप OAuth स्कोप का उपयोग नहीं करते हैं तो एक मनमाना स्ट्रिंग)। यह करने के बाद, अधिकृत एपीआई पर क्लिक करें।
  6. चरण 2 और चरण 3 वर्गों में, OAuth 2.0 प्रवाह के माध्यम से जाना और सत्यापित करें कि प्रत्येक चरण के रूप में इरादा काम करता है।

आप का उपयोग करके अपने कार्यान्वयन को मान्य कर सकते गूगल खाता लिंक करना डेमो उपकरण।

टूल में, निम्न चरणों का पालन करें:

  1. क्लिक करें गूगल से प्रवेश करें बटन में।
  2. वह खाता चुनें जिसे आप लिंक करना चाहते हैं।
  3. सेवा आईडी दर्ज करें।
  4. वैकल्पिक रूप से एक या अधिक क्षेत्र दर्ज करें जिसके लिए आप एक्सेस का अनुरोध करेंगे।
  5. प्रारंभ डेमो क्लिक करें।
  6. संकेत मिलने पर, पुष्टि करें कि आप सहमति दे सकते हैं और लिंकिंग अनुरोध को अस्वीकार कर सकते हैं।
  7. पुष्टि करें कि आपको अपने प्लेटफ़ॉर्म पर पुनर्निर्देशित किया गया है।