OAuth पर आधारित 'Google साइन इन' की मदद से खाता लिंक करना "Streamलाइन" लिंक करना

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

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

पहली इमेज: आपकी सेट की गई कार्रवाई को उपयोगकर्ता की Google प्रोफ़ाइल का ऐक्सेस मिलने के बाद, इसका इस्तेमाल पुष्टि करने वाले अपने सिस्टम में उस उपयोगकर्ता से मिलती-जुलती जानकारी ढूंढने के लिए किया जा सकता है.

व्यवस्थित तरीके से लिंक करने के तरीके का इस्तेमाल करके खाता लिंक करने के लिए, यह सामान्य तरीका अपनाएं:

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

आवाज़ से खाता बनाने में मदद पाएं

अगर बोलकर खाता बनाने की अनुमति दी जाती है, तो Assistant उपयोगकर्ता से पूछती है कि उन्हें ये काम करने हैं या नहीं:

  • Google खाते की जानकारी का इस्तेमाल करके, अपने सिस्टम पर नया खाता बनाएं या
  • अगर आपके पास Google खाता नहीं है, तो किसी दूसरे खाते से पुष्टि करने वाले सिस्टम में साइन इन करें.

अगर आपको खाता बनाने में होने वाली रुकावट को कम करना है, तो हमारा सुझाव है कि आप बोलकर खाता बनाने की अनुमति दें. उपयोगकर्ता को वॉइस फ़्लो को सिर्फ़ तब छोड़ना होगा, जब वह किसी ऐसे खाते से साइन इन करना चाहता हो जो Google का नहीं है.

बोलकर खाता बनाने की अनुमति न दें

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

हम बनाने की अनुमति न देने का सुझाव देते हैं, अगर:

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

  • आपके पास खाता बनाने के फ़्लो का पूरा कंट्रोल होना चाहिए. उदाहरण के लिए, अगर खाता बनाते समय आपको उपयोगकर्ता को अपनी सेवा की शर्तें दिखाने की ज़रूरत है, तो खाता बनाने की अनुमति न दी जा सकती है.

OAuth पर आधारित 'Google साइन इन' को "बेहतर तरीके से लिंक करना" लागू करना

खाते, इंडस्ट्री स्टैंडर्ड के OAuth 2.0 फ़्लो से लिंक किए जाते हैं. Actions on Google, इंप्लिसिट फ़्लो और ऑथराइज़ेशन कोड फ़्लो के साथ काम करता है.

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

ऑथराइज़ेशन कोड फ़्लो में, आपको दो एंडपॉइंट की ज़रूरत होगी:

  • ऑथराइज़ेशन एंडपॉइंट, जो उन उपयोगकर्ताओं के साइन-इन यूज़र इंटरफ़ेस (यूआई) को दिखाने के लिए ज़िम्मेदार है जिन्होंने पहले से साइन इन नहीं किया है. साथ ही, उपयोगकर्ता को कुछ समय तक इस्तेमाल किए जाने वाले ऑथराइज़ेशन कोड के तौर पर ऐक्सेस का अनुरोध करने के लिए सहमति लेनी होती है.
  • टोकन एक्सचेंज एंडपॉइंट, दो तरह के एक्सचेंज के लिए ज़िम्मेदार है:
    1. लंबे समय तक चलने वाले रीफ़्रेश टोकन और कुछ समय तक चलने वाले ऐक्सेस टोकन के लिए ऑथराइज़ेशन कोड बदलता है. यह एक्सचेंज तब होता है, जब उपयोगकर्ता, खाता जोड़ने के फ़्लो से गुज़रता है.
    2. वह कम समय तक चलने वाले ऐक्सेस टोकन के लिए, लंबे समय तक चलने वाले रीफ़्रेश टोकन की अदला-बदली करता है. यह ऐसा तब होता है, जब Google को नए ऐक्सेस टोकन की ज़रूरत होती है, क्योंकि उसकी समयसीमा खत्म हो चुकी होती है.

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

प्रोजेक्ट कॉन्फ़िगर करें

व्यवस्थित तरीके से लिंक करने की सुविधा का इस्तेमाल करने के लिए, अपने प्रोजेक्ट को कॉन्फ़िगर करने के लिए, यह तरीका अपनाएं:

  1. Actions कंसोल खोलें और वह प्रोजेक्ट चुनें जिसका आपको इस्तेमाल करना है.
  2. डेवलप करें टैब पर क्लिक करें और खाता लिंक करना चुनें.
  3. खाता जोड़ना के बगल में मौजूद स्विच को चालू करें.
  4. खाता बनाएं सेक्शन में, हां चुनें.

  5. लिंक करने का तरीका में, OAuth और Google साइन इन और इंप्लिसिट को चुनें.

  6. क्लाइंट की जानकारी में, ये काम करें:

    • Google से आने वाले अनुरोधों की पहचान करने के लिए, Google Actions से जारी किए गए Client-ID के लिए कोई वैल्यू असाइन करें.
    • अपने ऑथराइज़ेशन और टोकन एक्सचेंज एंडपॉइंट के यूआरएल डालें.
  7. सेव करें पर क्लिक करें.

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

To support the OAuth 2.0 implicit flow, your service makes an authorization endpoint available by HTTPS. This endpoint is responsible for authenticating and 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.

When your Action needs to call one of your service's authorized APIs, Google uses this endpoint to get permission from your users to call these APIs on their behalf.

A typical OAuth 2.0 implicit flow session initiated by Google has the following flow:

  1. Google opens your authorization endpoint in the user's browser. 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.
  2. Your service creates an access token and returns it to Google by redirecting the user's browser back to Google with the access token attached to the request.
  3. Google calls your service's APIs, and attaches the access token with each request. Your service verifies that the access token grants Google authorization to access the API and then completes the API call.

Handle authorization requests

When your Action needs to perform account linking via an OAuth 2.0 implicit 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.
response_type The type of value to return in the response. For the OAuth 2.0 implicit flow, the response type is always token.

For example, if your authorization endpoint is available at https://myservice.example.com/auth, a request might look like:

GET https://myservice.example.com/auth?client_id=GOOGLE_CLIENT_ID&redirect_uri=REDIRECT_URI&state=STATE_STRING&response_type=token

For your authorization endpoint to handle sign-in requests, do the following steps:

  1. Verify the client_id and redirect_uri values to prevent granting access to unintended or misconfigured client apps:

    • Confirm that the client_id matches the client ID you assigned to Google.
    • Confirm that the URL specified by the redirect_uri parameter has the following form:
      https://oauth-redirect.googleusercontent.com/r/YOUR_PROJECT_ID
      YOUR_PROJECT_ID is the ID found on the Project settings page of the Actions Console.
  2. 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.

  3. Generate an access token that Google will use to access your API. The access token can be any string value, but it must uniquely represent the user and the client the token is for and must not be guessable.

  4. Send an HTTP response that redirects the user's browser to the URL specified by the redirect_uri parameter. Include all of the following parameters in the URL fragment:

    • access_token: the access token you just generated
    • token_type: the string bearer
    • state: the unmodified state value from the original request The following is an example of the resulting URL:
      https://oauth-redirect.googleusercontent.com/r/YOUR_PROJECT_ID#access_token=ACCESS_TOKEN&token_type=bearer&state=STATE_STRING

Google's OAuth 2.0 redirect handler will receive the access token and confirm that the state value hasn't changed. After Google has obtained an access token for your service, Google will attach the token to subsequent calls to your Action as part of the AppRequest.

Handle automatic linking

After the user gives your Action consent to access their Google profile, Google sends a request that contains a signed assertion of the Google user's identity. The assertion contains information that includes the user's Google Account ID, name, and email address. The token exchange endpoint configured for your project handles that request.

If the corresponding Google account is already present in your authentication system, your token exchange endpoint returns a token for the user. If the Google account doesn't match an existing user, your token exchange endpoint returns a user_not_found error.

The request has the following form:

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&consent_code=CONSENT_CODE&scope=SCOPES

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

Token endpoint parameters
grant_type The type of token being exchanged. For these requests, this parameter has the value urn:ietf:params:oauth:grant-type:jwt-bearer.
intent For these requests, the value of this parameter is `get`.
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.
consent_code Optional: When present, a one-time code that indicates that the user has granted consent for your Action to access the specified scopes.
scope Optional: Any scopes you configured Google to request from users.

When your token exchange endpoint receives the linking request, it should do the following:

JWT के दावे की पुष्टि करना और उसे डिकोड करना

अपनी भाषा के लिए JWT-डिकोडिंग लाइब्रेरी का इस्तेमाल करके, JWT के दावे की पुष्टि की जा सकती है और उसे डिकोड किया जा सकता है. टोकन के हस्ताक्षर की पुष्टि करने के लिए, Google की सार्वजनिक कुंजियों का इस्तेमाल करें. ये JWK या PEM फ़ॉर्मैट में उपलब्ध होती हैं.

डिकोड किए जाने पर, JWT का दावा यहां दिए गए उदाहरण की तरह दिखता है:

{
  "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
  "locale": "en_US"
}

टोकन के हस्ताक्षर की पुष्टि करने के अलावा, इस बात की पुष्टि करें कि दावे को जारी करने वाला (iss फ़ील्ड) https://accounts.google.com है और ऑडियंस (aud फ़ील्ड) वही क्लाइंट आईडी है जिसे आपकी सेट की गई कार्रवाई को असाइन किया गया है.

Check if the Google account is already present in your authentication system

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, the user has already signed up and you can issue an access token.

If neither the Google Account ID nor the email address specified in the assertion matches a user in your database, the user hasn't signed up yet. In this case, your token exchange endpoint should reply with a HTTP 401 error, that specifies error=user_not_found, as in the following example:

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

{
  "error":"user_not_found",
}
When Google receives the 401 error response with a user_not_found error, Google calls your token exchange endpoint with the value of the intent parameter set to create and sending an ID token that contains the user's profile information with the request.

'Google साइन इन' सुविधा की मदद से खाता बनाने की प्रक्रिया को मैनेज करना

जब किसी उपयोगकर्ता को आपकी सेवा पर खाता बनाना होता है, तो Google आपके टोकन एक्सचेंज एंडपॉइंट से अनुरोध करता है, जिससे intent=create की जानकारी मिलती है. इसका उदाहरण नीचे दिया गया है:

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&consent_code=CONSENT_CODE&assertion=JWT[&NEW_ACCOUNT_INFO]

assertion पैरामीटर में एक JSON वेब टोकन (JWT) होता है. यह Google उपयोगकर्ता की पहचान के बारे में, हस्ताक्षर किया गया दावा करता है. JWT में ऐसी जानकारी होती है जिसमें उपयोगकर्ता का Google खाता आईडी, नाम, और ईमेल पता शामिल होता है. इसका इस्तेमाल, अपनी सेवा के लिए नया खाता बनाने के लिए किया जा सकता है.

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

JWT के दावे की पुष्टि करना और उसे डिकोड करना

अपनी भाषा के लिए JWT-डिकोडिंग लाइब्रेरी का इस्तेमाल करके, JWT के दावे की पुष्टि की जा सकती है और उसे डिकोड किया जा सकता है. टोकन के हस्ताक्षर की पुष्टि करने के लिए, Google की सार्वजनिक कुंजियों का इस्तेमाल करें. ये JWK या PEM फ़ॉर्मैट में उपलब्ध होती हैं.

डिकोड किए जाने पर, JWT का दावा यहां दिए गए उदाहरण की तरह दिखता है:

{
  "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
  "locale": "en_US"
}

टोकन के हस्ताक्षर की पुष्टि करने के अलावा, इस बात की पुष्टि करें कि दावे को जारी करने वाला (iss फ़ील्ड) https://accounts.google.com है और ऑडियंस (aud फ़ील्ड) वही क्लाइंट आईडी है जिसे आपकी सेट की गई कार्रवाई को असाइन किया गया है.

उपयोगकर्ता जानकारी सत्यापित करें और नया खाता बनाएं

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

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

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

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

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

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

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

{
  "token_type": "Bearer",
  "access_token": "ACCESS_TOKEN",
  
  "expires_in": SECONDS_TO_EXPIRATION
}

पुष्टि करने के लिए, वॉइस यूज़र इंटरफ़ेस डिज़ाइन करें

यह पता करना कि उपयोगकर्ता की पुष्टि हो चुकी है या नहीं और खाता लिंक करने की प्रक्रिया शुरू करें

  1. Actions कंसोल में अपना Actions Builder प्रोजेक्ट खोलें.
  2. अपनी सेट की गई कार्रवाई में खाता लिंक करने की प्रोसेस शुरू करने के लिए, एक नया सीन बनाएं:
    1. सीन पर क्लिक करें.
    2. नया सीन जोड़ने के लिए, जोड़ें (+) आइकॉन पर क्लिक करें.
  3. नए सीन में, शर्तों के लिए, जोड़ें आइकॉन पर क्लिक करें.
  4. एक शर्त जोड़ें जो यह जांच करती है कि बातचीत से जुड़ा उपयोगकर्ता, पुष्टि किया गया उपयोगकर्ता है या नहीं. अगर जांच पूरी नहीं हो पाती, तो आपकी सेट की गई कार्रवाई, बातचीत के दौरान खाता लिंक नहीं कर पाएगी. साथ ही, इसे ऐसे फ़ंक्शन का ऐक्सेस देना होगा जिसके लिए खाता लिंक करने की ज़रूरत नहीं होती.
    1. शर्त वाले Enter new expression फ़ील्ड में, यह लॉजिक डालें: user.verificationStatus != "VERIFIED"
    2. ट्रांज़िशन में, ऐसा सीन चुनें जिसमें खाता लिंक करने की ज़रूरत न हो या कोई ऐसा सीन चुनें जो सिर्फ़ मेहमान के लिए उपलब्ध सुविधा के लिए शुरुआती पॉइंट हो.

  1. शर्तों के लिए, ' जोड़ें' आइकॉन पर क्लिक करें.
  2. अगर उपयोगकर्ता की पहचान से जुड़ी जानकारी नहीं है, तो खाता लिंक करने के फ़्लो को ट्रिगर करने के लिए कोई शर्त जोड़ें.
    1. शर्त वाले Enter new expression फ़ील्ड में, यह लॉजिक डालें: user.verificationStatus == "VERIFIED"
    2. ट्रांज़िशन में जाकर, खाता लिंक करना सिस्टम सीन चुनें.
    3. सेव करें पर क्लिक करें.

सेव करने के बाद, आपके प्रोजेक्ट में खाता लिंक करने वाला <SceneName>_AccountLinking नाम का एक नया सीन जोड़ा जाता है.

खाता लिंक करने के सीन को पसंद के मुताबिक बनाना

  1. सीन में जाकर, खाता लिंक करने वाले सिस्टम का सीन चुनें.
  2. सूचना भेजें पर क्लिक करें. इसके बाद, एक छोटा वाक्य जोड़कर उपयोगकर्ता को बताएं कि कार्रवाई को उनकी पहचान का ऐक्सेस क्यों चाहिए. उदाहरण के लिए, "आपकी प्राथमिकताएं सेव करने के लिए".
  3. सेव करें पर क्लिक करें.

  1. शर्तें सेक्शन में, अगर उपयोगकर्ता खाता लिंक करने की प्रोसेस पूरी कर लेता है पर क्लिक करें.
  2. अगर उपयोगकर्ता अपने खाते को लिंक करने की सहमति देता है, तो फ़्लो को कॉन्फ़िगर करना. उदाहरण के लिए, ज़रूरी किसी भी कारोबारी लॉजिक को प्रोसेस करने और मूल सीन पर वापस जाने के लिए वेबहुक को कॉल करें.
  3. सेव करें पर क्लिक करें.

  1. शर्तें सेक्शन में, अगर उपयोगकर्ता खाता जोड़ने की प्रोसेस को रद्द करता है या उसे खारिज करता है, तो उस पर क्लिक करें.
  2. अगर उपयोगकर्ता अपने खाते को लिंक करने के लिए सहमत नहीं है, तो फ़्लो कॉन्फ़िगर करें. उदाहरण के लिए, स्वीकार करने वाला मैसेज भेजें और उन सीन पर रीडायरेक्ट करें जिनमें ऐसी सुविधाएं दी गई हों जिनके लिए खाता लिंक करने की ज़रूरत न हो.
  3. सेव करें पर क्लिक करें.

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

डेटा ऐक्सेस करने के अनुरोधों को मैनेज करना

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