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
### You use tokens to write applications that make authenticated requests to IBM Watson™ services without embedding service credentials in every call.
74
+
75
+
### You can write an authentication proxy in IBM® Bluemix® that obtains and returns a token to your client application, which can then use the token to call the service directly. This proxy eliminates the need to channel all service requests through an intermediate server-side application, which is otherwise necessary to avoid exposing your service credentials from your client application.
76
+
77
+
```
78
+
using IBM.Watson.DeveloperCloud.Services.Conversation.v1;
79
+
using IBM.Watson.DeveloperCloud.Utilities;
80
+
81
+
void Start()
82
+
{
83
+
Credentials credentials = new Credentials(<service-url>)
84
+
{
85
+
AuthenticationToken = <authentication-token>
86
+
};
87
+
Conversation _conversation = new Conversation(credentials);
88
+
}
89
+
```
90
+
91
+
### There is a helper class included to obtain tokens from within your Unity application.
92
+
93
+
```
94
+
using IBM.Watson.DeveloperCloud.Utilities;
95
+
96
+
AuthenticationToken _authenticationToken;
97
+
98
+
void Start()
99
+
{
100
+
if (!Utility.GetToken(OnGetToken, <service-url>, <service-username>, <service-password>))
101
+
Log.Debug("ExampleGetToken", "Failed to get token.");
Log.Debug("ExampleGetToken", "created: {0} | time to expiration: {1} minutes | token: {2}", _authenticationToken.Created, _authenticationToken.TimeUntilExpiration, _authenticationToken.Token);
108
+
}
109
+
```
110
+
70
111
## Documentation
71
112
To read the documentation you need to have a **chm reader** installed. Open the documentation by selecting API Reference the Watson menu (**Watson -> API Reference**).
0 commit comments