Hpcompassport Email Profile Already Exists in Our System Please Try Again With Different Email

Google Sign-In for the Banana provides the simplest and easiest user experience to users and developers both for account linking and account creation. Your Action can request access to your user's Google profile during a conversation, including the user's proper name, e-mail address, and profile picture.

The profile data tin be used to create a personalized user experience in your Activity. If you accept apps on other platforms and they apply Google Sign-In, you tin also find and link to an existing user'due south business relationship, create a new account, and establish a direct channel of communication to the user.

To perform business relationship linking with Google Sign-In, you enquire the user to give consent to access their Google profile. You then use the information in their profile, for case their email address, to identify the user in your system.

Implement Google Sign-In account linking

Follow the steps in the following sections to add Google Sign-In account linking to your Action.

Configure the projection

To configure your project to employ Google Sign-In business relationship linking, follow these steps:

  1. Open up the Actions Console and select a project.
  2. Click the Develop tab and choose Account linking.
  3. Enable the switch next to Account linking.
  4. In the Account creation section, select Yeah.
  5. In Linking type, select Google Sign In.

  6. Open Customer Data and take notation of the value of Client ID issued by Google to your Actions.

  7. Click Salve.

Design the voice user interface for the authentication menstruum

Check if the user is verified and start the account linking flow

  1. Open your Actions Builder project in the Actions Console.
  2. Create a new scene to start account linking in your Activity:
    1. Click Scenes.
    2. Click the add together (+) icon to add together a new scene.
  3. In the newly created scene, click the add icon for Conditions.
  4. Add a condition that checks if the user associated with the conversation is a a verified user. If the check fails, your Action can't perform account linking during the conversation, and should fall dorsum to providing access to functionality that doesn't crave account linking.
    1. In the Enter new expression field under Condition, enter the following logic: user.verificationStatus != "VERIFIED"
    2. Under Transition, select a scene that doesn't require account linking or a scene that is the entry point to guest-only functionality.

  1. Click the add icon for Conditions.
  2. Add a condition to trigger an account linking menses if the user doesn't take an associated identity.
    1. In the Enter new expression field under Condition, enter the following logic:: user.verificationStatus == "VERIFIED"
    2. Under Transition, select the Account Linking system scene.
    3. Click Save.

Subsequently saving, a new account linking system scene chosen <SceneName>_AccountLinking is added to your project.

Customize the business relationship linking scene

  1. Under Scenes, select the account linking system scene.
  2. Click Send prompt and add a curt sentence to depict to the user why the Action needs to access their identity (for example "To save your preferences").
  3. Click Save.

  1. Under Conditions, click If user successfully completes account linking.
  2. Configure how the catamenia should continue if the user agrees to link their account. For example, call the webhook to procedure any custom concern logic required and transition back to the originating scene.
  3. Click Save.

  1. Under Conditions, click If user cancels or dismisses account linking.
  2. Configure how the flow should proceed if the user doesn't hold to link their account. For instance, send an acknowledging bulletin and redirect to scenes that provide functionality that doesn't crave account linking.
  3. Click Salve.

  1. Nether Conditions, click If system or network error occurs.
  2. Configure how the flow should proceed if the account linking flow can't be completed because of system or network errors. For example, transport an acknowledging bulletin and redirect to scenes that provide functionality that doesn't require account linking.
  3. Click Salvage.

Access profile data in your backend

After the user authorizes your action to admission their Google profile, you will receive a Google ID token that contains the user'southward Google profile information in every subsequent request to your action.

To access the user's profile data, you need to first validate and decode the token by doing the post-obit:

  1. Use a JWT-decoding library for your linguistic communication to decode the token, and use Google's public keys (bachelor in JWK or PEM format) to verify the token'southward signature.
  2. Verify that the token'southward issuer (iss field in the decoded token) is https://accounts.google.com and that the audition (aud field in the decoded token) is the value of Client ID issued by Google to your Actions, which is assigned to your project in the Actions console.

The following is an example of a decoded token:

{   "sub": 1234567890,        // The unique ID of the user'due south Google Account   "iss": "https://accounts.google.com",        // The token'southward issuer   "aud": "123-abc.apps.googleusercontent.com", // Client ID assigned to your Actions project   "iat": 233366400,         // Unix timestamp of the token'south creation time   "exp": 233370000,         // Unix timestamp of the token'due south expiration time   "name": "Jan Jansen",   "given_name": "January",   "family_name": "Jansen",   "email": "jan@gmail.com", // If present, the user'southward electronic mail address   "locale": "en_US" }

If you apply the Actions on Google Fulfillment library for Node.js, it takes intendance of validating and decoding the token for you, and gives you admission to the profile content, as shown in the following code snippets.

... const app = conversation({   // REPLACE THE PLACEHOLDER WITH THE CLIENT_ID OF YOUR Deportment Project   clientId: CLIENT_ID, }); ... // Invoked on successful completion of business relationship linking catamenia, check if we demand to // create a Firebase user. app.handle('linkAccount', async conv => {   let payload = conv.headers.authorization;   if (payload) {   // Become UID for Firebase auth user using the email of the user     const email = payload.email;     if (!conv.user.params.uid && email) {       effort {         conv.user.params.uid = (look auth.getUserByEmail(email)).uid;       } take hold of (east) {         if (eastward.code !== 'auth/user-not-establish') {           throw e;         }         // If the user is not found, create a new Firebase auth user         // using the email obtained from Google Banana         conv.user.params.uid = (await auth.createUser({email})).uid;       }     }   } });        

Handle information access requests

To handle data access request, just verify that the user asserted by the Google ID token is already present in your database. The following snippet of lawmaking shows an instance of how to check if orders for a user already exist in a Firestore database:

... app.handle('Place_Order', async conv => {   const order = conv.session.params.order;   const userDoc = dbs.user.medico(conv.user.params.uid);   const orderHistory = userDoc.drove("orderHistory");   if (orderHistory) {     // Order history exists, and then the user already placed an gild.     // Update counter for society blazon.     look orderHistory.md(order).update({ count: admin.firestore.FieldValue.increase(i)});   } else {     // First club they identify     await orderHistory.doc(order).set({ option: order, count: i});     options.forEach(opt => {       if (opt != order) {         orderHistory.doc(opt).set({ pick: opt, count: 0});       }     });   }   render conv.add(`Your ${club} has been placed. ` +       'Thank you for using Boba Bonanza, see you soon!'); });        

gilmorepostrod.blogspot.com

Source: https://developers.google.com/assistant/identity/google-sign-in

0 Response to "Hpcompassport Email Profile Already Exists in Our System Please Try Again With Different Email"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel