Imported Upstream version 1.2.0
[platform/upstream/iotivity.git] / cloud / samples / client / README
1 To build cloud client samples, add WITH_TCP, TARGET_TRANSPORT=IP, WITH_CLOUD and WITH_MQ option to build command line
2
3 ex) scons WITH_TCP=yes TARGET_TRANSPORT=IP WITH_CLOUD=yes WITH_MQ=PUB,SUB
4
5 Cloud clients runs over CoAP over TCP transport. So you should declare WITH_TCP option.
6
7 Once you get samples which file name is 'aircon_controlee' and 'aircon_controller', you need 'Auth Code' to register resources on cloud with account scenario.
8
9 Cloud stack has sample github and google oauth2 adaptor.
10
11 So you can instantly test samples using 'Auth Code'.
12
13 Paste below URL to your browser
14
15 [Github] https://github.com/login?return_to=%2Flogin%2Foauth%2Fauthorize%3Fclient_id%3Dea9c18f540323b0213d0%26redirect_uri%3Dhttp%253A%252F%252Fwww.example.com%252Foauth_callback%252F
16 [Google] https://accounts.google.com/o/oauth2/v2/auth?redirect_uri=http://www.example.com/oauth2callback&prompt=consent&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.profile&response_type=code&client_id=447649044559-f9r5sl6op3kkk0312u384o4g6hhucje1.apps.googleusercontent.com&access_type=offline
17
18 And you'll see login page provided by oauth2 providers, and after logged in, you'll be redirectd to below site.
19
20 http://www.example.com/oauth_callback/?code=bf9beb5db17ea476fa46
21
22 You can get 'Auth Code', value of '?code' query string.
23
24 The 'Auth Code' is one time token. So you need other token to run each sample.