クライアント情報(デバイス、接続、およびアプリケーション)を渡す pass-client-info
範囲 pass-client-info-scope
このドキュメントでは、クライアント情報(デバイス、接続、アプリケーション)をプログラマーアプリケーションからAdobe Pass Authentication REST API または SDK に渡すための詳細とクックブックを集計します。
クライアント情報を提供するメリットは次のとおりです。
- HBA をサポートできる一部のデバイスタイプと MVPD の場合に、Home Base Authentication(HBA) を適切に有効にする機能。
- 一部のデバイスタイプで TTL を適切に適用する機能(例:TV 接続デバイスでの認証セッションの TTL を長く設定する)。
- Entitlement Service Monitoring(ESM) を使用して、デバイスの種類をまたいで分類レポートでビジネス指標を適切に集計する機能。
- 様々なビジネス・ルールを適切に適用する機能のブロックを解除します ( 例: 最適化 ) を使用できます。
概要 pass-client-info-overview
クライアント情報は、次の要素で構成されます。
- デバイス ユーザーが Programmer コンテンツを使用しようとするデバイスのハードウェアおよびソフトウェア属性に関する情報。
- 接続 ユーザーがAdobe Pass Authentication サービスや Programmer サービス(サーバー間実装など)に接続する際の、デバイスの接続属性に関する情報。
- アプリ ユーザーが Programmer コンテンツを使用しようとする登録済みアプリケーションに関する情報。
クライアント情報は、次の表に示すキーで構築された JSON オブジェクトです。
primaryHardwareType
, osName
, osFamily
, browserName
, browserVendor
, connectionSecure
.API リファレンス api-ref
この節では、Adobe Pass Authentication REST API または SDK を使用する際にクライアント情報を処理する API を示します。
REST API rest-api
Adobe Pass Authentication Services では、次の方法でクライアント情報を受信できます。
- As a header: "X-Device-Info"
- As a クエリパラメータ: "device_info"
- As a post パラメータ: "device_info"
SDK
JavaScript SDK js-sdk
AccessEnabler JavaScript SDK は、上書きされない限りAdobe Pass Authentication Services に渡されるクライアント情報 JSON オブジェクトをデフォルトで構築します。
AccessEnabler JavaScript SDK は、 上書きのみ クライアント情報の JSON オブジェクトから、 setRequestor's applicationId options パラメーター。
applicationId
パラメータ値は、プレーンテキストの文字列値である必要があります。プログラマーアプリケーションが applicationId を渡す場合、残りのクライアント情報キーは AccessEnabler JavaScript SDK によって引き続き計算されます。
iOS/tvOS SDK ios-tvos-sdk
AccessEnabler iOS/tvOS SDK は、上書きされない限りAdobe Pass Authentication Services に渡されるクライアント情報 JSON オブジェクトをデフォルトで構築します。
AccessEnabler iOS/tvOS SDK は、 全体を上書きする クライアント情報 JSON オブジェクトを setOptions's device_info パラメーター。
Android/FireOS SDK and-fire-os-sdk
The AccessEnabler
Android/FireOS SDK は、デフォルトでクライアント情報の JSON オブジェクトをビルドします。このオブジェクトは、上書きされない限りAdobe Pass Authentication Services に渡されます。
The AccessEnabler
Android/FireOS SDK は、 全体を上書きする クライアント情報 JSON オブジェクトを setOptions's/setOptions's device_info
パラメーター。
device_info
パラメータ値は必ず指定してください Base64 エンコード済み 文字列値。クックブック cookbooks
この節では、異なるデバイスタイプの場合に、クライアント情報 JSON オブジェクトを構築するためのクックブックを示します。
Android android
デバイス情報は、次のように構築できます。
接続情報は、次の方法で構築できます。
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
getSystemService(Context.CONNECTIVITY_SERVICE).getActiveNetworkInfo().getType()
"WIFI","BLUETOOTH","MOBILE","ETHERNET","VPN","DUMMY","MOBILE_DUN","WIMAX","notAccessible"
アプリケーション情報は、次の方法で構築できます。
サンプルコード
private JSONObject computeClientInformation() {
String LOGGING_TAG = "DefineClass.class";
JSONObject clientInformation = new JSONObject();
String connectionType;
try {
ConnectivityManager cm = (ConnectivityManager) getContext().getSystemService(CONNECTIVITY_SERVICE);
NetworkInfo activeNetwork = cm.getActiveNetworkInfo();
if (activeNetwork != null && activeNetwork.isConnectedOrConnecting()) {
switch (activeNetwork.getType()) {
case ConnectivityManager.TYPE_WIFI: {
connectionType = "WIFI";
break;
}
case ConnectivityManager.TYPE_BLUETOOTH: {
connectionType = "BLUETOOTH";
break;
}
case ConnectivityManager.TYPE_MOBILE: {
connectionType = "MOBILE";
break;
}
case ConnectivityManager.TYPE_ETHERNET: {
connectionType = "ETHERNET";
break;
}
case ConnectivityManager.TYPE_VPN: {
connectionType = "VPN";
break;
}
case ConnectivityManager.TYPE_DUMMY: {
connectionType = "DUMMY";
break;
}
case ConnectivityManager.TYPE_MOBILE_DUN: {
connectionType = "MOBILE_DUN";
break;
}
case ConnectivityManager.TYPE_WIMAX: {
connectionType = "WIMAX";
break;
}
default:
connectionType = ConnectivityManager.EXTRA_OTHER_NETWORK_INFO;
}
} else {
connectionType = ConnectivityManager.EXTRA_NO_CONNECTIVITY;
}
} catch (Exception e) {
connectionType = "notAccessible";
}
try {
clientInformation.put("model",Build.MODEL);
clientInformation.put("vendor", Build.BRAND);
clientInformation.put("manufacturer",Build.MANUFACTURER);
clientInformation.put("version",Build.DEVICE);
clientInformation.put("osName","Android");
clientInformation.put("osVersion",Build.VERSION.RELEASE);
clientInformation.put("connectionType",connectionType);
clientInformation.put("applicationId","CNN");
} catch (JSONException e) {
Log.e(LOGGING_TAG, e.getMessage());
}
return Base64.encodeToString(clientInformation.toString().getBytes(), Base64.NO_WRAP);
}
FireTV fire-tv
デバイス情報は、次のように構築できます。
接続情報は、次の方法で構築できます。
アプリケーション情報は、次の方法で構築できます。
iOS/tvOS ios-tvos
デバイス情報は、次のように構築できます。
接続情報は、次の方法で構築できます。
アプリケーション情報は、次の方法で構築できます。
サンプルコード
+ (NSString *)computeClientInformation {
struct utsname u;
uname(&u);
NSString *hardware = [NSString stringWithCString:u.machine encoding:NSUTF8StringEncoding];
UIDevice *device = [UIDevice currentDevice];
NSString *deviceType;
switch (UI_USER_INTERFACE_IDIOM()) {
case UIUserInterfaceIdiomPhone:
deviceType = @"MobilePhone";
break;
case UIUserInterfaceIdiomPad:
deviceType = @"Tablet";
break;
case UIUserInterfaceIdiomTV:
deviceType = @"TV";
break;
default:
deviceType = @"Unknown";
}
CGRect screenRect = [[UIScreen mainScreen] bounds];
NSNumber *screenWidth = @((float) screenRect.size.width);
NSNumber *screenHeight = @((float) screenRect.size.height);
Reachability *reachability = [Reachability reachabilityForInternetConnection];
[reachability startNotifier];
NetworkStatus status = [reachability currentReachabilityStatus];
NSString *connectionType;
if (status == NotReachable) {
connectionType = @"notConnected";
} else if (status == ReachableViaWiFi) {
connectionType = @"WiFi";
} else if (status == ReachableViaWWAN) {
connectionType = @"cellular";
}
NSMutableDictionary *clientInformation = [@{
@"type": deviceType,
@"model": device.model,
@"vendor": @"Apple",
@"manufacturer": @"Apple",
@"version": [hardware stringByReplacingOccurrencesOfString:device.model withString:@""],
@"osName": device.systemName,
@"osVersion": device.systemVersion,
@"displayWidth": screenWidth,
@"displayHeight": screenHeight,
@"connectionType": connectionType,
@"applicationId": @"CNN"
} mutableCopy];
NSError *error;
NSData *jsonData = [NSJSONSerialization dataWithJSONObject:clientInformation options:NSJSONWritingPrettyPrinted error:&error];
NSString *base64Encoded = [jsonData base64EncodedStringWithOptions:0];
return base64Encoded;
}
Roku roku
デバイス情報は、次のように構築できます。
接続情報は、次の方法で構築できます。
アプリケーション情報は、次の方法で構築できます。
XBOX 1/360 xbox
デバイス情報は、次のように構築できます。
接続情報は、次の方法で構築できます。
アプリケーション情報は、次の方法で構築できます。
リソース