You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+81-28Lines changed: 81 additions & 28 deletions
Original file line number
Diff line number
Diff line change
@@ -25,9 +25,12 @@ Use this SDK to build Watson-powered applications in Unity.
25
25
## Before you begin
26
26
Ensure that you have the following prerequisites:
27
27
28
-
*An IBM Cloud account. If you don't have one, [sign up][ibm_cloud_registration].
28
+
*You need an [IBM Cloud][ibm-cloud-onboarding] account.
29
29
*[Unity][get_unity]. You can use the **free** Personal edition.
30
+
31
+
## Configuring Unity
30
32
* Change the build settings in Unity (**File > Build Settings**) to any platform except for web player/Web GL. The Watson Developer Cloud Unity SDK does not support Unity Web Player.
33
+
* If using Unity 2018.2 or later you'll need to set Scripting Runtime Version in Build Settings to .NET 4.x equivalent. We need to access security options to enable TLS 1.2.
31
34
32
35
## Getting the Watson SDK and adding it to Unity
33
36
You can get the latest SDK release by clicking [here][latest_release].
@@ -75,50 +78,44 @@ To get started with the Watson Services in Unity, click on each service below to
- With some service instances, you authenticate to the API by using **[IAM](#iam)**.
84
+
- In other instances, you authenticate by providing the **[username and password](#username-and-password)** for the service instance.
85
+
- Visual Recognition uses a form of [API key](#api-key) only with instances created before May 23, 2018. Newer instances of Visual Recognition use [IAM](#iam).
To find out which authentication to use, view the service credentials. You find the service credentials for authentication the same way for all Watson services:
90
89
91
-
For services that authenticate using an apikey, you can instantiate the service instance using a `Credential` object with an `apikey` and `url`.
90
+
1. Go to the IBM Cloud **[Dashboard][watson-dashboard]** page.
91
+
1. Either click an existing Watson service instance or click **Create**.
92
+
1. Click **Show** to view your service credentials.
93
+
1. Copy the `url` and either `apikey` or `username` and `password`.
92
94
93
-
**Important**: Instantiation with `apikey` works only with Visual Recognition service instances created before May 23, 2018. Visual Recognition instances created after May 22 use IAM.
95
+
In your code, you can use these values in the service constructor or with a method call after instantiating your service.
Some services use token-based Identity and Access Management (IAM) authentication. IAM authentication uses a service API key to get an access token that is passed with the call. Access tokens are valid for approximately one hour and must be regenerated.
100
+
101
+
You supply either an IAM service **API key** or an **access token**:
105
102
106
-
You can also authenticate a service using IAM authentication. You can either supply a valid access token in the `iamTokenOptions` or get an access token using an `apikey`.
103
+
- Use the API key to have the SDK manage the lifecycle of the access token. The SDK requests an access token, ensures that the access token is valid, and refreshes it if necessary.
104
+
- Use the access token if you want to manage the lifecycle yourself. For details, see [Authenticating with IAM tokens](https://console.bluemix.net/docs/services/watson/getting-started-iam.html). If you want to switch to API key, in a coroutine, override your stored IAM credentials with an IAM API key and yield until the credentials object `HasIamTokenData()` returns `true`.
107
105
106
+
#### Supplying the IAM API key
108
107
```cs
109
-
voidIEnumeratorTokenExample()
108
+
IEnumeratorTokenExample()
110
109
{
111
110
// Create IAM token options and supply the apikey.
**Important**: This type of authentication works only with Visual Recognition instances created before May 23, 2018. Newer instances of Visual Recognition use [IAM](#iam).
Copy file name to clipboardExpand all lines: Scripts/Services/Assistant/v1/README.md
-22Lines changed: 0 additions & 22 deletions
Original file line number
Diff line number
Diff line change
@@ -9,28 +9,6 @@ You complete these steps to implement your application:
9
9
10
10
* Develop your application. You code your application to connect to the Assistant workspace through API calls. You then integrate your app with other systems that you need, including back-end systems and third-party services such as chat services or social media.
11
11
12
-
### Instantiating and authenticating the service
13
-
Before you can send requests to the service it must be instantiated and credentials must be set.
Copy file name to clipboardExpand all lines: Scripts/Services/Conversation/v1/README.md
-22Lines changed: 0 additions & 22 deletions
Original file line number
Diff line number
Diff line change
@@ -9,28 +9,6 @@ You complete these steps to implement your application:
9
9
10
10
* Develop your application. You code your application to connect to the Conversation workspace through API calls. You then integrate your app with other systems that you need, including back-end systems and third-party services such as chat services or social media.
11
11
12
-
### Instantiating and authenticating the service
13
-
Before you can send requests to the service it must be instantiated and credentials must be set.
Copy file name to clipboardExpand all lines: Scripts/Services/Discovery/v1/README.md
-24Lines changed: 0 additions & 24 deletions
Original file line number
Diff line number
Diff line change
@@ -4,30 +4,6 @@ The IBM Watson™ [Discovery][discovery] service makes it possible to rapidly bu
4
4
## Usage
5
5
The IBM Watson™ [Discovery][discovery] Service uses data analysis combined with cognitive intuition in order to take your unstructured data and enrich it so that you can query it to return the information that you need from it.
6
6
7
-
### Instantiating and authenticating the service
8
-
Before you can send requests to the service it must be instantiated and credentials must be set.
Creates an environment for the service instance. Note: You can create only one environment per service instance. Attempting to create another environment for the same service instance results in an error. See the [Discovery service home page][discovery-sizing] for additional information about sizing and pricing. To create a free trial environment, specify the value of size as 0 (zero).
0 commit comments