vania-janet/multiturn-rag-retrieval-data huggingface dataset:
This action allows users to update their attributes after they answer your initial questionnaire.



Excellent! Your dashboard is configured and you're ready to start setting attributes.





 Step 2: Creating user attributes 

When your users interact with your questionnaire, you can map their answers to specific attributes, then add those attributes to their file.

Your application is responsible for mapping the answers to the specific attributes that you want to add to the profile.



1. Update the profile with the attribute.

curl --request PUT https://<region>.appid.cloud.ibm.com/management/v4/<tenantID>/users/<userID>/profile --header 'Authorization: Bearer <IAMToken>' --header 'Content-Type: application/json' -d '{
"profile": {
"attributes": {
“food-preference”: “vegetarian, glutten-free”
}
}
}'
2. View the profile to verify that it was updated correctly.

curl --request GET https://<region>.appid.cloud.ibm.com/management/v4/<tenantID>/users/<userID>/profile --header 'Authorization: Bearer <IAMToken>' --header 'Content-Type: application/json'

Successful response output:

{
"id": "5ce78e09-1356-4ef8-a45d-808b633101db",
"identities": [],
"attributes": {
"food-preference": "vegetarian, gluten-free"
}
}



Great work!





 Step 3: Injecting attributes into tokens 

Becoming more popular, you decide to implement a "deal-of-the-day". You want the first thing that the user sees when they sign in to your application to be a coupon for something that matches their dietary preferences. You can achieve this goal by injecting the attributes that are stored in their profiles into their tokens.
Because the user_id value that you submit is included in the customer_id value that is added to the X-Watson-Metadata header in each message request, the user_id syntax must meet the requirements for header fields as defined in [RFC 7230](https://tools.ietf.org/html/rfc7230section-3.2).

To support these user-based capabilities, add the [updateUserID() method](https://web-chat.global.assistant.watson.cloud.ibm.com/docs.html?to=api-instance-methodsupdateuserid) in the code snippet before you paste it into your web page.

If you enable security, you set the user ID in the JSON Web Token instead. For more information, see [Authenticating users](https://cloud.ibm.com/docs/watson-assistant?topic=watson-assistant-web-chat-securityweb-chat-security-authenticate).

In the following example, the user ID L12345 is added to the script.

<script>
window.watsonAssistantChatOptions = {
integrationID: 'YOUR_INTEGRATION_ID',
region: 'YOUR_REGION',
serviceInstanceID: 'YOUR_SERVICE_INSTANCE',
onLoad: function(instance) {
instance.updateUserID('L12345');
instance.render();
}
};
setTimeout(function(){
const t=document.createElement('script');
t.src='https://web-chat.global.assistant.dev.watson.appdomain.cloud/versions/' +
(window.watsonAssistantChatOptions.clientVersion || 'latest') +
'/WatsonAssistantChatEntry.js';
document.head.appendChild(t);
});
</script>
Show more



 Apple devices 

On Apple devices, the Intelligent Tracking Prevention feature automatically deletes any client-side cookie after 7 days.
5. Enter the attributes that you want to add as a JSON object. For example, {"role":"admin"}.







 Setting custom attributes with the API 

As an administrator, you can add custom information about your users to their profile such a role that they hold or preference that they have by setting a custom attribute. To set an attribute, you can use the App ID API to call the /users endpoint. To set custom attributes before a user signs in to your application for the first time, see [preregistering future users](https://cloud.ibm.com/docs/appid?topic=appid-preregister).

By default, custom attributes are modifiable and can be updated by using an App ID access token from a client application. This means that without taking proper precautions either the user or the application can update custom attributes immediately following the first user sign-in, if they have an access token. This can potentially lead to unintended consequences. For example, a user might change their role from user to admin, which might expose administrative privileges to malicious users.



1. Go to the User profiles > Settings tab of the App ID dashboard.
2. Toggle custom attributes to Enabled.
3. Obtain an IAM token.



1. In the IBM Cloud dashboard, click Manage > Access (IAM).
2. Select IBM Cloud API keys.
3. Click Create an IBM Cloud API key.
4. Give your key a name and describe it. Click Create. A screen displays with your key.
5. Click Copy or Download your key. When you close the screen, you can no longer access the key.
6. Make the following cURL request with the API key that you created.
Step 3: Integrate the App ID instance as the ID provider for the administrator's account 



1. Go to [Manage → Access (IAM) → Identity Providers](https://cloud.ibm.com/iam/identity-providers). For Type, choose IBM Cloud App ID, then click Create.
2. Specify a name and select the App ID instance from the drop-down list.
3. Select the checkbox to enable the ID provider.

Zoom

![Create identity provider](https://cloud.ibm.com/docs-content/v1/content/5f399fa794584e8a662591b494b9a99aa927c74c/quantum-computing/images/org-guide-idp-reference.png)

Figure 3. Create identity provider page
4. The default IdP URL is shown. Share this URL with users when they need to log in.







 Step 4: Add a dynamic rule to the access group 

The access group needs a dynamic rule to test whether it should be applied to an IDP user when they log in.

Because the dynamic rules are evaluated during login, any changes are picked up the next time the user logs in.



1. Navigate to [Manage → IAM → Access groups](https://cloud.ibm.com/iam/groups) and click your access group to open its details page.
2. Click the Dynamic rules tab, then click Add.



* Provide a name.
* For the Authentication method, choose Users federated by IBM Cloud AppID, then select the IDP from the Identity provider drop-down list.



Zoom

![Create Dynamic Rule](https://cloud.ibm.com/docs-content/v1/content/5f399fa794584e8a662591b494b9a99aa927c74c/quantum-computing/images/org-guide-create-dynamic-rule1.png)

Figure 9. Create Dynamic Rule
3.
{region}.databases.cloud.ibm.com/v4/ibm/deployments/{id}/users' -H "Authorization: Bearer $APIKEY" -H "Content-Type: application/json" -d '{"username":"jane_smith", "password":"newsupersecurepassword"}'

Once the task has finished, you can retrieve the new user's connection strings, from the /users/{userid}/connections endpoint.





 Adding users to Service Credentials 

Creating a new user from the CLI doesn't automatically populate that user's connection strings into Service Credentials. If you want to add them there, you can create a new credential with the existing user information.

Enter the username and password in the JSON field Add Inline Configuration Parameters, or specify a file where the JSON information is stored. For example, putting {"existing_credentials":{"username":"Robert","password":"supersecure"}} in the field generates Service Credentials with the username "Robert" and password "supersecure" filled into connection strings.

Generating credentials from an existing user does not check for or create that user.
Instead of giving users a personal access token, you can give them access to a secret, add the token to a secret, and centrally manage all tokens and access the secret allows.



* If you're using a personal access token, select No to indicate that you aren't using a secret and provide your personal access token.
* If you're using a secret, select Yes and click Select from Secrets Manager. Select your service instance, secret group, and secret. If you don't see your secret, make sure you're using the correct secret group and service instance.



The message No service instance available might be displayed if you haven't created a secret or if you don't have the correct access to use secrets, even if you have service instances that are created.
7. If applicable, set your deployment target and add your software version.
8. Click Add version.







 Configuring the version details 



1. From the version list, click the row that contains your software.
2. Review the version details, and click Next.
3. Depending on your software type, there might be additional steps, including setting deployment values.
4. Click Next.





 Setting deployment values 

If applicable to your software type, you can set deployment values that users are required to specify when they install the software. You can add new deployment values or import deployment values from an existing version.



 Adding new deployment values 



1. Click Configure version > Next.
2. Click Add deployment values.
3. In the table, select Parameter > Add.
4. To customize parameters, select a parameter and click Edit.







 Importing existing values 

Complete these steps if you previously set deployment values for an existing version and want to import the values to your current version.

Imported values don't replace any deployment values that you already added to your current version.



1. Click Configure version > Next.
2. Click Add deployment values.
3. Click Import values from a previous version.
4. Select the version that contains the values that you want to import.
5. Click Import.
"id": "f1772fcc-ff70-4d88-81a0-07dd7a3d988f",
"idpUserInfo": {
"displayName": "Test User",
"active": true,
"mfaContext": {},
"emails":
{
"value": "testuser@test.com",
"primary": true
}
],
"meta": {
"lastLogin": "2019-05-20T16:33:20.699Z",
"created": "2019-05-20T16:25:13.019Z",
"location": "/v1/6b8ab644-1d4a-4b3e-bcd9-777ba8430a51/Users/f1772fcc-ff70-4d88-81a0-07dd7a3d988f",
"lastModified": "2019-05-20T16:33:20.707Z",
"resourceType": "User"
},
"schemas":
"urn:ietf:params:scim:schemas:core:2.0:User"
],
"name": {
"givenName": "Test",
"familyName": "User",
"formatted": "Test User"
},
"id": "f1772fcc-ff70-4d88-81a0-07dd7a3d988f",
"status": "CONFIRMED",
"idpType": "cloud_directory"
}
}
]
}

To see the full user data set that App ID supports, check out [the SCIM core schema](https://datatracker.ietf.org/doc/html/rfc7643section-8.2).









 Adding users
Select All bare metal servers or All virtual servers, depending on the resource that you want the user to be able to tag.







 Granting users access to tag service IDs 

Complete the following steps to assign the administrator role on the IAM Identity Service for a user:



1. Click Manage > Access (IAM), and select Users.
2. Click the user's name from the table.
3. Select the IAM Identity service and click Next.
4. Select All resources and click Next.
5. Select the Administrator role.
6. Click Review > Add.
7. Click Assign.







 Granting users access to tag service IDs by using the API 

To assign the administrator role on the IAM Identity Service for a user, call the [IAM Policy Management API](https://cloud.ibm.com/apidocs/iam-policy-management) as shown in the following example request. Replace values with your target user's IAM ID and account ID.



* Curl
* Java
* Python
* Go
* Node



curl -X POST 'https://iam.cloud.ibm.com/v1/policies' -H 'Authorization: Bearer $TOKEN' -H 'Content-Type: application/json' -d '{
"type": "access",
"description": "Administrator role for the IAM Identity Service so that user can tag service IDs",
"subjects": [
{
"attributes":
{
"name": "iam_id",
"value": "IBMid-123453user"
}
]
}'
],
"roles":[
{
"role_id": "crn:v1:bluemix:public:iam::::role:Administrator"
}
],
"resources":[
{
"attributes":
{
"name": "accountId",
"value": "$ACCOUNT_ID"
},
{
Customizing your user experience 

In a world with everything at our finger tips, people expect their experiences to be tailored to them. Whether we're having an in-person conversation or shopping online, we want to see only the things that apply to us. By using this step-by-step guide, you can learn how to harness the power of user attributes and really capture your users attention with App ID.



 Scenario 

You're a developer for an online retailer, with a specialization in food. You're tasked with creating a personalized experience for your app users. You decide to focus your efforts on creating targeted advertising based on things that you know about your users. So, when a user signs up for your app, you ask them a few questions with answers that they can choose from. For example, you might ask the following question:

Do you have any dietary preferences?



* I'm a vegetarian.
* I'm a pescatarian.
* I'm dairy-free.
* I'm gluten-free.
* I'm low carb.



You can then map their answers to [specific attributes](https://cloud.ibm.com/docs/appid?topic=appid-profiles) that you can use to target the advertising that they're shown.

Although this tutorial is written for web apps that use Cloud Directory, attributes can be used in a much broader sense. Custom attributes can be anything that you want them to be! If you stay under 100k attributes and you format them as a plain JSON object, you can store all types of information.





 Before you begin 

Ready? Let's get started!

Be sure that you have the following prerequisites before you begin:



* An instance of the App ID service
* A set of service credentials







 Step 1: Configuring your App ID instance 

Before you can start adding attributes for your users, you need to configure your instance of App ID.



1. In the Identity Providers tab of the service dashboard, enable Cloud Directory.
[Learn more about the roles that you need](https://cloud.ibm.com/docs/monitoring?topic=monitoring-iam).
8. Click Assign.









 Step 4. Add a user or service ID to the access group 

You can add users or service IDs to an existing group.



 Add a user to the access group 

Complete the following steps to add a user:



1. From the menu bar, click Manage > Access (IAM), and select Access Groups.
2. Select the name of the group that you want to assign access to.
3. Click Add users on the Users tab.
4. Select the users that you want to add from the list, and click Add to group.







 Add a service ID to the access group 

Complete the following steps to add a service ID:



1. From the menu bar, click Manage > Access (IAM), and select Access Groups.
2. Select the name of the group that you want to assign access to.
3. Click the Service IDs tab, and click Add service ID.
4. Select the IDs that you want to add from the list, and click Add to group.
Writer <br><br> * All Reader actions.<br> * Add or update post-authentication redirection URLs.<br> * Configure your identity provider options.<br> * Configure your Login Widget appearance which includes the logo, color, and language.<br> * Configure your tokens.<br> * Delete an action URL that is configured for Cloud Directory.<br> * Configure advanced password policies.<br> * Update a Cloud Directory password policy in regex form.<br> * Get the metadata that is used to link your SAML provider.<br> * Start the sign-up process for a new Cloud Directory user.<br> * View the result of a new user sign-up.
3. To create an API key for the service ID, follow these steps:



1. Click the API keys tab on the SO user service ID page.
2. Click Create.
3. Add a name and description to easily identify the API key, for example, SO user API key.
4. Click Create.
5. Save your API key by copying or downloading it to secure location.



The API key is to be used as the PIN for the SO user logins, and cannot be retrieved. Make sure to make a copy of it in this step.







 2. Create service IDs and API keys for the normal user 

To create a service ID for the normal user and the corresponding API key, complete the following steps:



1. In the IBM Cloud console, go to Manage > Access (IAM), and select Service IDs.
2. To create the service ID for the normal user, follow these steps:



1. Click Create.
2. Create a name Normal user and description for the normal user service ID.
3. Click Create.



3. To create an API key for the service ID, follow these steps:



1. Click the API keys tab on the Normal user service ID page.
2. Click Create.
3. Add a name and description to easily identify the API key, for example, Normal user API key.
4. Click Create.
5. Save your API key by copying or downloading it to secure location.



The API key is to be used as the PIN for the normal user logins, and cannot be retrieved. Make sure to make a copy of it in this step.







 3. Create service IDs and API keys for the anonymous user 

To create a service ID for the anonymous user and the corresponding API key, complete the following steps:



1. In the IBM Cloud console, go to Manage > Access (IAM), and select Service IDs.
2. To create the service ID for the anonymous user, follow these steps:



1. Click Create.
2.
You must also provide generation parameter and specify generation=2. For more information, see Generation in the [Virtual Private Cloud API reference](https://cloud.ibm.com/apidocs/vpcapi-generation-parameter).



 Add user tag when a file share is created 

Make a POST /shares request and specify the user_tags property. This example creates a share with three user tags, env:test1, env:test2, and env:prod.

curl -X POST "$rias_endpoint/v1/shares?version=2023-07-11&generation=2&maturity=beta&maturity=beta" -H "Authorization: Bearer $iam_token" -H 'Content-Type: application/json' -d '{
"name": "share-name1",
"size": 2300,
"profile": {
"name": "tier-3iops"
},
"user_tags": [
"env:test1",
"env:test2",
"env:prod"
],
"zone": {
"name": "us-south-1"
}
}'





 Modify user tags for an existing file share 

Add new user tags to an existing file share by making a PATCH /shares call and specify the user tags in the user_tags property. You can specify new tags for a file share without any tags and the user tags are added. If you specify different tags, the existing tags are modified.

The following example modifies a file share that is identified by ID by renaming the share and adding user tags.

curl -X PATCH "$rias_endpoint/v1/shares/432f1a4d-4aac-4ba1-922c-76fdbcbeb1e3?version=2023-07-11&generation=2&maturity=beta&maturity=beta" -H "Authorization: $iam_token" -d '{
"name": "myshare-patch-1",
"user_tags": [
"ut8",
Creating a new user from the CLI or API doesn't automatically populate that user's connection strings into Service Credentials. If you want to add them there, you can create a new credential with the existing user information.

Enter the username and password in the JSON field Add Inline Configuration Parameters, or specify a file where the JSON information is stored. For example, {"existing_credentials":{"username":"Robert","password":"supersecure"}}.

Generating credentials from an existing user does not check for or create that user.







 Connection String Breakdown 



 The amqps Section 

The "amqps" section contains information that is suited for your applications that make connections to RabbitMQ.



Table 1. RabbitMQ/uri connection information

 Field Name Index Description 

 Type Type of connection - for RabbitMQ, it is "uri" 
 Scheme Scheme for a URI - for RabbitMQ, it is "amqps" 
 Path Path for a uri 
 Authentication Username The username that you use to connect. 
 Authentication Password A password for the user - might be shown as $PASSWORD 
 Authentication Method How authentication takes place; "direct" authentication is handled by the driver. 
 Hosts 0... A hostname and port to connect to 
 Composed 0... A URI combining Scheme, Authentication, Host, and Path 
 Certificate Name The allocated name for the self-signed certificate for database deployment 
 Certificate Base64 A base64 encoded version of the certificate. 





* 0... indicates that there might be one or more of these entries in an array.



For more information on using this information to connect, see the [Connecting an External Application](https://cloud.ibm.com/docs/messages-for-rabbitmq?topic=messages-for-rabbitmq-external-app) page.





 The stomp_ssl Section 

The stomp_ssl section contains the information that a STOMP client needs to connect to your deployment.



Table 2. RabbitMQ/stomp_ssl connection information

 Field Name Index Description 

 Type Type of connection - for STOMP, it is stomp
You can define user tags in label or key-value format. You can create user tags or add existing tags to snapshots. You can also add tags when you use a snapshot of a volume during [instance creation](https://cloud.ibm.com/docs/vpc?topic=vpc-snapshots-vpc-manage&interface=uisnapshots-vpc-instancevol-tags-ui).

You can create, view, and manage user tags in the [UI](https://cloud.ibm.com/docs/vpc?topic=vpc-snapshots-vpc-manage&interface=uisnapshots-vpc-add-tags-ui), from the [CLI](https://cloud.ibm.com/docs/vpc?topic=vpc-snapshots-vpc-manage&interface=clisnapshots-vpc-add-tags-cli), or with the [API](https://cloud.ibm.com/docs/vpc?topic=vpc-snapshots-vpc-manage&interface=clisnapshots-vpc-add-tags-cli), and remove them at any time.





 Access management tags for Block Storage for VPC snapshots 

You can use access management tags to organize access control by creating flexible resource groupings, enabling your storage resources to grow without requiring updates to Cloud Identity and Access Management (IAM) policies. You create access management tags in IAM or with the Global Search and Tagging API, and then [add them to new or existing snapshots](https://cloud.ibm.com/docs/vpc?topic=vpc-snapshots-vpc-manage&interface=uisnapshots-vpc-add-tags-ui).

For more information about managing tags for your account, see [Working with tags](https://cloud.ibm.com/docs/account?topic=account-tag&interface=ui).







 Next steps
You must also provide generation parameter and specify generation=2. For more information, see Generation in the [Virtual Private Cloud API reference](https://cloud.ibm.com/apidocs/vpcapi-generation-parameter).



 Add user tag when a file share is created 

Make a POST /shares request and specify the user_tags property. This example creates a share with three user tags, env:test1, env:test2, and env:prod.

curl -X POST "$rias_endpoint/v1/shares?version=2023-07-11&generation=2&maturity=beta&maturity=beta" -H "Authorization: Bearer $iam_token" -H 'Content-Type: application/json' -d '{
"name": "share-name1",
"size": 2300,
"profile": {
"name": "tier-3iops"
},
"user_tags": [
"env:test1",
"env:test2",
"env:prod"
],
"zone": {
"name": "us-south-1"
}
}'
Show more





 Modify user tags for an existing file share 

Add new user tags to an existing file share by making a PATCH /shares call and specify the user tags in the user_tags property. You can specify new tags for a file share without any tags and the user tags are added. If you specify different tags, the existing tags are modified.

The following example modifies a file share that is identified by ID by renaming the share and adding user tags.

curl -X PATCH "$rias_endpoint/v1/shares/432f1a4d-4aac-4ba1-922c-76fdbcbeb1e3?version=2023-07-11&generation=2&maturity=beta&maturity=beta" -H "Authorization: $iam_token" -d '{
"name": "myshare-patch-1",
"user_tags": [