JP2016177795A - Access authorization apparatus, access authorization method, program and communication system - Google Patents

Access authorization apparatus, access authorization method, program and communication system Download PDF

Info

Publication number
JP2016177795A
JP2016177795A JP2016046197A JP2016046197A JP2016177795A JP 2016177795 A JP2016177795 A JP 2016177795A JP 2016046197 A JP2016046197 A JP 2016046197A JP 2016046197 A JP2016046197 A JP 2016046197A JP 2016177795 A JP2016177795 A JP 2016177795A
Authority
JP
Japan
Prior art keywords
access
communication device
request
network
communication
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Abandoned
Application number
JP2016046197A
Other languages
Japanese (ja)
Inventor
大介 安次富
Daisuke Ajifu
大介 安次富
圭祐 南
Keisuke Minami
圭祐 南
博史 川添
Hiroshi Kawazoe
博史 川添
会津 宏幸
Hiroyuki Aizu
宏幸 会津
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Toshiba Corp
Original Assignee
Toshiba Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Toshiba Corp filed Critical Toshiba Corp
Priority to US15/069,333 priority Critical patent/US20160277413A1/en
Publication of JP2016177795A publication Critical patent/JP2016177795A/en
Abandoned legal-status Critical Current

Links

Images

Abstract

PROBLEM TO BE SOLVED: To properly switch access to a resource presented by an object apparatus.SOLUTION: An access authorization apparatus has a communication part, a state determination part, an access substitution part and a determination part. The communication part communicates with an object apparatus connected to a network and a communication apparatus capable of using a resource presented by the object apparatus. The state determination part acquires information for identifying a status of connection of the communication apparatus to the network from at least one of the communication apparatus and the object apparatus to determine the connection status on the basis of the information. The access substitution part transmits a request for using the resource presented by the object apparatus to the object apparatus. The determination part determines whether the communication apparatus transmits the request for using the resource presented by the object apparatus to the object apparatus or the access substitution part transmits said request to the object apparatus.SELECTED DRAWING: Figure 1

Description

本発明の実施形態は、アクセス認可装置、アクセス認可方法、プログラムおよび通信システムに関する。   Embodiments described herein relate generally to an access authorization device, an access authorization method, a program, and a communication system.

家電などのホームネットワーク内の機器が、スマートフォン等に搭載されたアプリケーションに対して提供するREST API(Representational State Transfer Application Programming Interface)(以下、プライベートAPI)へのアクセス認可を、家電以外の機器で行う方法が知られている。アクセス認可とは、特定のアプリケーションがアクセスしてよいか否かの判断のことである。   A device in a home network such as a home appliance authorizes access to a REST API (Representative State Transfer Programming Interface) (hereinafter referred to as a private API) provided to an application installed in a smartphone or the like. The method is known. Access authorization is the determination of whether or not a specific application can access.

一方、機器がインターネット上などの外部サーバに接続され、外部サーバ経由で当該機器の監視や制御が実現可能なシステムにおいて、外部サーバが、プライベートAPIと同様のREST APIを公開し、このREST API経由で当該機器の制御を行う方法が知られている。当該外部サーバが公開するAPIを以降、パブリックAPIと呼ぶ。   On the other hand, in a system in which a device is connected to an external server such as the Internet and the device can be monitored and controlled via an external server, the external server publishes a REST API similar to a private API, and passes through this REST API. A method for controlling the device is known. The API released by the external server is hereinafter referred to as a public API.

上記2つのAPI(プライベートAPIとパブリックAPI)が併存するケースにおいて、ユーザには両者を切り替えるメリットがある。例えば、宅内での利用時にはプライベートAPIに切り換えることで、サーバに制御ログを残さなくてすむ。また、法的に切り替えを義務付けられる可能性もある。しかしながら、正当なアプリケーションにだけアクセス認可しつつ、両者をシームレスに切り替える方法は知られていない。   In the case where the two APIs (private API and public API) coexist, the user has an advantage of switching between the two. For example, when using in a home, it is not necessary to leave a control log on the server by switching to a private API. In addition, there is a possibility that legal switching is required. However, there is no known method for seamlessly switching between both while authorizing access only to legitimate applications.

特開2014−6798号公報Japanese Patent Application Laid-Open No. 2014-6798

本発明の実施形態は、対象機器が提供するリソースへアクセスする手法を適切に切り替えることを目的とする。   An object of the embodiment of the present invention is to appropriately switch a method of accessing a resource provided by a target device.

本発明の実施形態としてアクセス認可装置は、通信部と、状態判定部と、アクセス代行部と、決定部とを備える。前記通信部は、ネットワークに接続された対象機器と、および前記対象機器が提供するリソースを利用可能な通信装置と通信する。前記状態判定部は、前記通信装置と前記ネットワークとの接続状態を特定するための情報を前記通信装置および前記対象機器の少なくとも一方から取得し、前記情報に基づき前記接続状態を判定する。前記アクセス代行部は、前記対象機器が提供するリソースの利用要求を前記対象機器に送信する。前記決定部は、前記接続状態に基づき、前記対象機器が提供するリソースの利用要求を前記通信装置が前記対象機器に送信するか、前記アクセス代行部が前記対象機器に送信するかを決定する。   As an embodiment of the present invention, an access authorization device includes a communication unit, a state determination unit, an access proxy unit, and a determination unit. The communication unit communicates with a target device connected to a network and a communication device that can use resources provided by the target device. The state determination unit acquires information for specifying a connection state between the communication device and the network from at least one of the communication device and the target device, and determines the connection state based on the information. The access proxy unit transmits a request for using a resource provided by the target device to the target device. The determination unit determines whether the communication device transmits a resource use request provided by the target device to the target device or the access proxy unit transmits to the target device based on the connection state.

第1の実施形態に関わる通信システムの構成図。1 is a configuration diagram of a communication system according to a first embodiment. トークン記憶部に記憶された情報の例を示す図。The figure which shows the example of the information memorize | stored in the token memory | storage part. 対象機器情報記憶部に記憶された情報の例を示す図。The figure which shows the example of the information memorize | stored in the object apparatus information storage part. 第1の実施形態に係る通信シーケンスの例を示す図。The figure which shows the example of the communication sequence which concerns on 1st Embodiment. 図4に続く通信シーケンスの例を示す図。The figure which shows the example of the communication sequence following FIG. トークン発行処理のフローチャートを示す図。The figure which shows the flowchart of a token issue process. 第1の実施形態に係る通信システムの他の構成例を示す図。The figure which shows the other structural example of the communication system which concerns on 1st Embodiment. 第1の実施形態に係る通信システムの他の構成例を示す図。The figure which shows the other structural example of the communication system which concerns on 1st Embodiment. 第1の実施形態に係る通信システムの他の構成例を示す図。The figure which shows the other structural example of the communication system which concerns on 1st Embodiment. 第2の実施形態に関わる通信システムの構成図。The block diagram of the communication system in connection with 2nd Embodiment. 確認画面の例を示す図。The figure which shows the example of a confirmation screen. 第3の実施形態に係る通信システムの構成例を示す図。The figure which shows the structural example of the communication system which concerns on 3rd Embodiment. 第3の実施形態に係る対象機器情報記憶部の構成例を示す図。The figure which shows the structural example of the object apparatus information storage part which concerns on 3rd Embodiment. 第3の実施形態に係る動作シーケンスの例を示す図。The figure which shows the example of the operation | movement sequence which concerns on 3rd Embodiment. 第3の実施形態に係る動作シーケンスの例を示す図。The figure which shows the example of the operation | movement sequence which concerns on 3rd Embodiment. 第3の実施形態に係る動作シーケンスの例を示す図。The figure which shows the example of the operation | movement sequence which concerns on 3rd Embodiment. 第4の実施形態に係る通信システムの他の構成例を示す図。The figure which shows the other structural example of the communication system which concerns on 4th Embodiment.

以下、図面を参照しながら、本発明の実施形態について説明する。   Hereinafter, embodiments of the present invention will be described with reference to the drawings.

(第1の実施形態)
本実施形態は、ユーザが宅外から宅内に移動すると、利用するAPIを自動的にパブリックAPIから、プライベートAPIに切り替えるように制御することを特徴とする。以下、本実施形態について詳細に説明する。
(First embodiment)
The present embodiment is characterized in that when the user moves from outside the house to the house, the API to be used is automatically switched from the public API to the private API. Hereinafter, this embodiment will be described in detail.

図1は、本発明の第1の実施形態に関わる通信システムの構成図である。この通信システムは、アクセス認可装置101と、通信装置201と、対象機器301と、中継装置401と、第1ネットワーク501と、第2ネットワーク601とを備える。   FIG. 1 is a configuration diagram of a communication system according to the first embodiment of the present invention. This communication system includes an access authorization device 101, a communication device 201, a target device 301, a relay device 401, a first network 501, and a second network 601.

第1ネットワーク501は、広域通信網である。本実施形態では、具体的には、インターネットを想定している。ただし、NGN(Next Generation Network)など、閉域網を含むその他のネットワークであっても構わない。   The first network 501 is a wide area communication network. In the present embodiment, specifically, the Internet is assumed. However, other networks including a closed network such as NGN (Next Generation Network) may be used.

第2ネットワーク601は、ローカル通信網である。本実施形態では、具体的には、ホームネットワークを想定している。物理媒体は有線(Ethernet(登録商標)等)、無線(WiFi、Bluetooth(登録商標)、Zigbee(登録商標)等)を問わない。上位の通信プロトコルは、IP(Internet Protocol)であることを想定しているが、これも本実施形態の通信シーケンスが同様に実行される限りにおいて、どのような通信プロトコルであってもよい。   The second network 601 is a local communication network. In this embodiment, specifically, a home network is assumed. The physical medium may be wired (Ethernet (registered trademark) or the like) or wireless (WiFi, Bluetooth (registered trademark), Zigbee (registered trademark), or the like). The upper communication protocol is assumed to be IP (Internet Protocol), but any communication protocol may be used as long as the communication sequence of the present embodiment is similarly executed.

中継装置401は、第1ネットワーク501と第2ネットワーク601を接続するルータである。本実施形態では、ホームネットワークとインターネットを接続する、NAT(Network Address Translation)機能を備えたブロードバンドルータであることを想定している。   The relay device 401 is a router that connects the first network 501 and the second network 601. In the present embodiment, it is assumed that the router is a broadband router having a NAT (Network Address Translation) function for connecting a home network and the Internet.

通信装置201は、エンドユーザが利用するスマートフォン、タブレット、PC等の装置である。本実施形態では、通信装置201はスマートフォンであることを想定している。ユーザは、宅外・宅内を問わずに、スマートフォンを携帯し、利用する。アクセス認可装置101が認可を与える対象は、スマートフォン上で動作するプログラムを構成要素として持つ、アプリケーションである。図1では、通信装置201は第1ネットワーク501と第2ネットワーク601に接続されているように描かれているが、第1ネットワーク501に接続されているが第2ネットワーク601に接続されていない状態、第1ネットワーク501に接続されていないが第2ネットワーク601に接続されている状態、両方のネットワークに接続されている状態など、種々の接続状態がある。   The communication device 201 is a device such as a smartphone, a tablet, or a PC used by an end user. In the present embodiment, it is assumed that the communication device 201 is a smartphone. A user carries and uses a smartphone regardless of whether the user is outside or inside the house. A target to which the access authorization device 101 grants an application is an application having a program that operates on a smartphone as a component. In FIG. 1, the communication device 201 is depicted as being connected to the first network 501 and the second network 601, but is connected to the first network 501 but not connected to the second network 601. There are various connection states such as a state in which the network is not connected to the first network 501 but is connected to the second network 601, and a state in which the network is connected to both networks.

対象機器301は、通信機能を持った家電またはセンサーなどの機器である。本実施形態では、ブロードバンドルータ配下のホームネットワークに接続されたデジタルテレビを想定する。対象機器301は、REST API(Representational State Transfer Application Programming Interface)を第2ネットワーク601、すなわち、ホームネットワークに公開している。このREST APIを以降、プライベートAPIと呼ぶことがある。本実施形態では、対象機器301は、HTTP(Hyper Text Transfer Protocol)でアクセス可能なAPIとして、プライベートAPIを公開しているものとする。   The target device 301 is a device such as a home appliance or a sensor having a communication function. In the present embodiment, a digital television connected to a home network under a broadband router is assumed. The target device 301 publishes a REST API (Representative State Transfer Application Programming Interface) on the second network 601, that is, the home network. Hereinafter, this REST API may be referred to as a private API. In the present embodiment, it is assumed that the target device 301 publishes a private API as an API that can be accessed using HTTP (Hyper Text Transfer Protocol).

通信装置201は、第2ネットワーク601を介して対象機器301と接続されているとき、対象機器301のプライベートAPIに第2ネットワーク601を介してHTTPリクエストを送信することで、所望のリソースを利用できる。例えば、テレビ番組の録画予約を行うプライベートAPIを利用するHTTPメッセージ例(以下、メッセージAとして参照する)を以下に記す。HTTP POSTメソッドを利用し、HTTPのリクエストボディにチャンネルや日時等を指定している。この例では、所望のリソースは、テレビ(対象機器301)の録画予約(reserved_programs)である。   When the communication apparatus 201 is connected to the target device 301 via the second network 601, a desired resource can be used by transmitting an HTTP request to the private API of the target device 301 via the second network 601. . For example, an HTTP message example (hereinafter referred to as message A) using a private API for making a recording reservation for a television program is described below. Using the HTTP POST method, a channel, date and time, etc. are designated in the HTTP request body. In this example, the desired resource is a recording reservation (reserved_programs) of the television (target device 301).

[メッセージA]

Figure 2016177795
[Message A]
Figure 2016177795

テレビのチャンネルを変更するプライベートAPIを利用するHTTPメッセージ例(以下、メッセージBとして参照する)を以下に示す。HTTP PUTメソッドを利用し、リクエストボディにチャンネルを指定している。この例では、通信装置201が利用しようとする所望のリソースは、テレビ(対象機器301)の状態(status)である。   An example of an HTTP message (hereinafter referred to as message B) using a private API for changing the TV channel is shown below. Using the HTTP PUT method, a channel is specified in the request body. In this example, the desired resource that the communication device 201 intends to use is the status of the television (target device 301).

[メッセージB]

Figure 2016177795
[Message B]
Figure 2016177795

以上は、あくまで実現方法の一形態であり、パラメータやURLは、上記の例に限定されるものではない。   The above is only one form of an implementation method, and parameters and URLs are not limited to the above examples.

アクセス認可装置101は、第1ネットワーク501に接続されたサーバ装置である。
アクセス認可装置101は、CPU、メモリおよびストレージで構成される一般的な計算機の構成を有することを想定しているが、クラウドシステム上の仮想サーバとして実現されてもよい。本実施形態では、具体的には、サーバ装置上に実装されたソフトウェアプログラムが、本実施形態に係るアクセス認可装置101の機能を実現することを想定している。このソフトウェアプログラムは、OAuth2.0、OpenID Connect
1.0といった、インターネット上でのアクセス認可を実現する標準規格に則った認可サーバ機能を備えているものとする。
The access authorization device 101 is a server device connected to the first network 501.
The access authorization device 101 is assumed to have a general computer configuration including a CPU, memory, and storage, but may be realized as a virtual server on a cloud system. In the present embodiment, specifically, it is assumed that a software program installed on the server device realizes the function of the access authorization device 101 according to the present embodiment. This software program is OAuth2.0, OpenID Connect
It is assumed that an authorization server function conforming to a standard for realizing access authorization on the Internet such as 1.0 is provided.

アクセス認可装置101は、通信部111、トークン発行部112、認可対象決定部(決定部)113、状態判定部114、トークン検証部115、アクセス代行部116、トークン記憶部117、対象機器情報記憶部118を備える。   The access authorization device 101 includes a communication unit 111, a token issuing unit 112, an authorization target determination unit (determination unit) 113, a state determination unit 114, a token verification unit 115, an access proxy unit 116, a token storage unit 117, and a target device information storage unit. 118.

通信部111は、第1ネットワーク501を介して通信装置201および対象機器301と通信を行う。対象機器301との通信は、中継装置401を介して行う。   The communication unit 111 communicates with the communication device 201 and the target device 301 via the first network 501. Communication with the target device 301 is performed via the relay device 401.

アクセス代行部116は、パブリックAPIを備え、パブリックAPIを、第1ネットワーク501に公開している。前述したように、具体的に、パブリックAPIは、本実施形態では、プライベートAPIと同様の、HTTPでアクセス可能なAPIを提供しているものとする。
例えば、アクセス認可装置101のドメインがapi.publiccontroller.example.comであり、対象機器301の識別子を“xyz”とした場合、対象機器301のプライベートAPI(前述したメッセージAおよびBを参照)に相当するパブリックAPIのURLは、それぞれ以下のように表現できる。

Figure 2016177795
The access proxy unit 116 includes a public API, and the public API is disclosed to the first network 501. As described above, specifically, in this embodiment, it is assumed that the public API provides an API accessible by HTTP, similar to the private API.
For example, when the domain of the access authorization device 101 is api.publiccontroller.example.com and the identifier of the target device 301 is “xyz”, this corresponds to the private API of the target device 301 (see the messages A and B described above). The URL of the public API to be expressed can be expressed as follows.
Figure 2016177795

トークン発行部112は、通信装置201から対象機器301のリソースへのアクセス許可要求を受信して、通信装置201の認証、ならびにリソースのアクセス権限者の認証および認可を行う。これらの認証および認可が成功すると、トークン発行部112は、アクセス許可情報(アクセストークン)を通信装置201に対して発行する。アクセストークンは、プライベートAPIへのアクセスのものと、パブリックAPIへのアクセスのものがあり、どちらを発行するかは、後述する認可対象決定部113と状態判定部114の結果に応じて判断する。通信装置201は、パブリックAPIまたはプライベートAPIへのアクセストークンの発行を受けると、対象機器301のリソースへのアクセスが可能となる。プライベートAPIの場合は、対象機器301に対して直接、リソースへアクセスし、パブリックAPIの場合は、アクセス認可装置101の代行により行われる。なお、この機能は、OAuth2.0の認可サーバの基本機能である。アクセス認可要求およびそれに基づく認証および認可等は、この標準仕様に則ったHTTPS通信で実現される。   The token issuing unit 112 receives a request for permission to access the resource of the target device 301 from the communication device 201, and performs authentication of the communication device 201 and authentication and authorization of a resource access authority. If these authentications and authorizations are successful, the token issuing unit 112 issues access permission information (access token) to the communication device 201. There are access tokens for access to the private API and access to the public API, and which one is issued is determined according to the results of the authorization object determination unit 113 and the state determination unit 114 described later. When the communication device 201 receives an access token issued to the public API or private API, the communication device 201 can access the resource of the target device 301. In the case of a private API, the resource is directly accessed to the target device 301, and in the case of a public API, the access is performed by the access authorization device 101. This function is a basic function of the authorization server of OAuth 2.0. The access authorization request and authentication and authorization based on the access authorization request are realized by HTTPS communication according to this standard specification.

トークン記憶部117は、トークン発行部112により発行されたアクセストークンを、リソースにアクセスする際に利用する1つ以上のAPI情報に関連付けて記憶する(後述する図2参照)。API情報は、APIに関する情報の一例である。その他の例としては、後述する図3のAPIパス(API情報の一部)などがある。
API情報は、それ自体の記述から、プライベートAPIとパブリックAPIを区別可能になっている。API情報は、例えばリソースアクセスのときに利用するURLを含む。またトークン記憶部117には、アクセス可能な対象機器のIDおよびユーザのUIDが、アクセストークンに関連づけられて記憶される。また、アクセストークンの有効期限も設定されている。リフレッシュトークンはアクセストークンと同時に発行され、その使用方法は後述する。
The token storage unit 117 stores the access token issued by the token issuing unit 112 in association with one or more API information used when accessing the resource (see FIG. 2 described later). The API information is an example of information related to the API. Other examples include an API path (part of API information) shown in FIG. 3 to be described later.
The API information can distinguish a private API and a public API from its own description. The API information includes a URL used for resource access, for example. Further, the token storage unit 117 stores the accessible target device ID and the user UID in association with the access token. An access token expiration date is also set. The refresh token is issued at the same time as the access token, and its usage will be described later.

トークン記憶部117自体の具体的な実現形態は、揮発メモリ上の簡易なハッシュ構造であってもよいし、KVS(Key Value Store)であってもよいし、不揮発ストレージに記憶するリレーショナルデータベース管理システムであってもよい。アクセストークンから、関連する認可対象情報を参照できるかぎりにおいて実現方法は問わない。   A specific implementation form of the token storage unit 117 itself may be a simple hash structure on a volatile memory, a KVS (Key Value Store), or a relational database management system stored in a non-volatile storage. It may be. As long as the related authorization object information can be referred from the access token, the implementation method is not limited.

トークン検証部115は、通信装置201からパブリックAPIへのリソースの利用要求を受けた場合に、当該アクセス要求に含まれるアクセストークンが、発行済みの有効なアクセストークンであるかを検証する。また、通信装置201からトークン発行要求を受信し、当該トークン発行要求にリフレッシュトークンが含まれる場合に、リフレッシュトークンが、発行済みの有効なものであるかを検証する。対象機器301からアクセストークン検証要求を受信し、当該検証要求に含まれるアクセストークンが、発行済みの有効なリフレッシュトークンであるかを検証する。トークン発行部112と同様、検証要求およびそれに基づく検証は、HTTPS通信で実現される。   When receiving a resource use request to the public API from the communication apparatus 201, the token verification unit 115 verifies whether the access token included in the access request is a valid access token that has been issued. In addition, when a token issuance request is received from the communication apparatus 201 and the refresh token is included in the token issuance request, it is verified whether the refresh token has been issued and is valid. The access token verification request is received from the target device 301, and it is verified whether the access token included in the verification request is a valid refresh token that has been issued. Similar to the token issuing unit 112, the verification request and the verification based thereon are realized by HTTPS communication.

対象機器情報記憶部118は、対象機器301にアクセスするために用いる情報(アクセス情報)と、対象機器301を一意に識別する対象機器ID(デバイス識別子)と、プライベートAPIのパスとを含む。アクセス情報は、対象機器301の外部IPアドレス、およびポート番号を含む。外部IPアドレスは、対象機器301と通信するときにアクセス認可装置101で把握される対象機器301のIPアドレスであり、通常、中継装置401の第1ネットワーク501側のポートに割り当てられたグローバルIPアドレスに一致する。なお、本実施形態のIPアドレスは、IPv4アドレスでも、IPv6アドレスでもよい。また、IPアドレス以外の種類のアドレスを用いてもよい。   The target device information storage unit 118 includes information (access information) used to access the target device 301, a target device ID (device identifier) that uniquely identifies the target device 301, and a private API path. The access information includes the external IP address of the target device 301 and the port number. The external IP address is the IP address of the target device 301 grasped by the access authorization device 101 when communicating with the target device 301, and is usually a global IP address assigned to the port on the first network 501 side of the relay device 401 Matches. Note that the IP address of this embodiment may be an IPv4 address or an IPv6 address. Moreover, you may use types of addresses other than an IP address.

アクセス情報は、アクセス認可装置101と対象機器301間の通信方式に依存して、様々なバリエーションが考えられる。例えば、対象機器301からアクセス認可装置101に通信コネクションを維持し続ける方式(WebSocketや、HTTP Long
Polling等)では、通信ソケット情報を加えてもよい。記憶部自体の実現形態は、トークン記憶部117と同様に種々の形態が可能である。
Depending on the communication method between the access authorization device 101 and the target device 301, various variations of the access information can be considered. For example, a method for maintaining a communication connection from the target device 301 to the access authorization device 101 (WebSocket or HTTP Long)
In the case of Polling or the like, communication socket information may be added. The realization form of the storage unit itself can be various forms as with the token storage unit 117.

本実施形態では、当該方式(WebSocketや、HTTP Long Polling等)を利用して、対象機器301がアクセス認可装置101と通信コネクションを維持し続けている状況を想定する。この状況では、アクセス認可装置101から中継装置401を介して対象機器301へ通信(TCP通信など)を開始することも可能である。   In the present embodiment, it is assumed that the target device 301 continues to maintain a communication connection with the access authorization apparatus 101 using the method (WebSocket, HTTP Long Polling, etc.). In this situation, it is also possible to start communication (TCP communication or the like) from the access authorization device 101 to the target device 301 via the relay device 401.

状態判定部114は、通信装置201からの要求(トークン発行要求、リソース利用要求など)が受信された際に、通信装置201の接続状態を判定する。具体的に、通信装置201が、第2ネットワーク601に接続されているか否かを判定する。具体的な判定方法として、状態判定部114が、対象機器情報記憶部118内の対象機器301の外部IPアドレスを参照し、これと、アクセス認可装置101で受信した要求の送信元IPアドレスが一致するか否かで、第2ネットワーク601に接続されているかを判定する。対象機器301の外部IPアドレスが送信元IPアドレスと一致する場合には、第2ネットワーク601に接続されていると判断し、一致しない場合は、第2ネットワーク601に接続されていない(すなわち第1ネットワーク501に接続されている)と判断する。要求の送信元IPアドレスは、通信装置201の第2ネットワーク601との接続状態(接続されているか否か、あるいは接続可能な状態か否か)を特定するための情報の一例である。
対象機器に対してIPアドレスの範囲を設定し、送信元IPアドレスが、当該範囲(複数の対象機器が取り得るIPアドレスの範囲など)に含まれるか否かで、第2ネットワークに接続されているかを判定してもよい。
第2ネットワーク601に接続されている場合、ユーザは宅内にいるとみなせるから、宅内からのアクセスであると言える。第2ネットワーク601に接続されていない場合、すなわち第1ネットワーク501に接続されている場合、宅外にいるとみなすことができるから、宅外からのアクセスであると言える。以下では、第2ネットワーク601を介したアクセス認可装置101へのアクセスを宅内からのアクセス、第2ネットワークを介さず、第1ネットワーク501を介したアクセス認可装置101へのアクセスを宅外からのアクセスと表現することがある。状態判断部114は、判定結果に基づき、通信装置201の接続状態を表す状態情報を生成する。状態情報は、通信装置201のアクセス認可装置101のアクセスが、宅内からのアクセスか、宅外からのアクセスかを表す。
The state determination unit 114 determines the connection state of the communication device 201 when a request (token issue request, resource use request, etc.) from the communication device 201 is received. Specifically, it is determined whether or not the communication device 201 is connected to the second network 601. As a specific determination method, the state determination unit 114 refers to the external IP address of the target device 301 in the target device information storage unit 118, and this matches the transmission source IP address of the request received by the access authorization device 101. It is determined whether or not it is connected to the second network 601 depending on whether or not it is performed. If the external IP address of the target device 301 matches the source IP address, it is determined that the target device 301 is connected to the second network 601, and if it does not match, the target device 301 is not connected to the second network 601 (that is, the first IP address). Connected to the network 501). The transmission source IP address of the request is an example of information for specifying a connection state (whether the communication device 201 is connected or is connectable) with the second network 601.
An IP address range is set for the target device, and the source IP address is connected to the second network depending on whether or not the source IP address is included in the range (such as a range of IP addresses that can be taken by a plurality of target devices). It may be determined whether or not.
When connected to the second network 601, it can be said that the access is from the home because the user can be regarded as being at home. When it is not connected to the second network 601, that is, when it is connected to the first network 501, it can be considered that the user is outside the home, and thus it can be said that the access is from outside the home. In the following, access to the access authorization device 101 via the second network 601 is access from inside the home, and access to the access authorization device 101 via the first network 501 is not access from the home without going through the second network. Sometimes expressed. The state determination unit 114 generates state information indicating the connection state of the communication device 201 based on the determination result. The status information indicates whether the access of the access authorization apparatus 101 of the communication apparatus 201 is from inside the house or from outside the house.

ここでは通信装置201が第2ネットワーク601に接続されているかを判断したが、通信装置201が第1ネットワーク501に接続されているが、第2ネットワーク601に接続可能な状態か否かを判断してもよい。例えばユーザが宅内に存在し、第2ネットワーク601にいつでも接続可能であるが、現時点では第1ネットワーク501に接続されている場合は、第2ネットワーク601に接続可能な状態であると判断できる。接続可能な状態かを判断するのに、通信装置201が、対象機器301に対して一定の距離範囲内に存在するかを判断してもよい。例えば、通信装置201がGPSを搭載しており、また、対象機器301の設置位置情報を予め取得しておくとする。この場合、通信装置201からGPSの位置情報を取得し、取得した位置情報を、設置位置情報と比較することで、第2ネットワーク601に接続可能な状態かを判断してもよい。または、対象機器301がGPSを搭載している場合には、当該対象機器301のGPSの位置情報を取得し、これを対象機器301の位置情報と比較することで、第2ネットワーク601に接続可能な状態かを判断してもよい。接続可能な状態の場合、接続されている状態(宅内からのアクセスの場合)に準じた処理を行っても良い。プライベートAPIへアクセスすることになった場合、通信装置201が自動的に接続先を第1ネットワーク501から第2ネットワーク601に切り換えても良い。GPSの位置情報は、通信装置201の第2ネットワーク601との接続状態を特定するための情報の一例である。   Here, it is determined whether or not the communication device 201 is connected to the second network 601, but it is determined whether or not the communication device 201 is connected to the first network 501 but is connectable to the second network 601. May be. For example, if the user exists in the home and can connect to the second network 601 at any time, but is currently connected to the first network 501, it can be determined that the user can connect to the second network 601. In order to determine whether the connection is possible, it may be determined whether the communication device 201 is within a certain distance range with respect to the target device 301. For example, it is assumed that the communication device 201 is equipped with a GPS, and the installation position information of the target device 301 is acquired in advance. In this case, GPS position information may be acquired from the communication device 201, and the acquired position information may be compared with the installation position information to determine whether the second network 601 can be connected. Alternatively, when the target device 301 is equipped with GPS, it is possible to connect to the second network 601 by acquiring the GPS location information of the target device 301 and comparing it with the location information of the target device 301. It may be determined whether the state is correct. In a connectable state, processing according to the connected state (in the case of access from home) may be performed. When the private API is accessed, the communication apparatus 201 may automatically switch the connection destination from the first network 501 to the second network 601. The GPS position information is an example of information for specifying a connection state of the communication device 201 with the second network 601.

認可対象決定部113は、状態判定部114で生成された状態情報を用いて、プライベートAPIおよびパブリックAPIのいずれをアクセス対象として許可するかを決定する。認可対象決定部113が認可を与える対象は、通信装置201に搭載されたアプリケーションに対してである。一例として、状態情報が宅内からのアクセスを示す場合は、プライベートAPI、宅外からのアクセスを示す場合は、パブリックAPIを認可の対象として決定する。通信装置201のアプリケーションがアクセスする対象は、上記プライベートAPI、もしくは、パブリックAPIであり、いずれのアクセスに認可を与えるか判断する。プライベートAPIが決定された場合、通信装置201が直接、対象機器301のプライベートAPIにアクセスする(すなわち通信装置201がリソースの利用要求を対象機器301に送信する)ことを意味する。パブリックAPIの場合、アクセス代行部116が、通信装置201からのパブリックAPIへのアクセスを受けて、アクセス代行部116がリソースの利用要求を対象機器301に送信する。なお、アクセス代行部116が対象機器301のリソースを利用する方法は事前に定められているものとする。専用のAPIが用意されていてもよいし、プライベートAPIのURLを含むデータを対象機器に送信し、対象機器が当該データに含まれるプライベットAPIのURLを内部的に解釈および実行してもよい。   The authorization target determination unit 113 uses the state information generated by the state determination unit 114 to determine which of the private API and public API is permitted as an access target. The object to which the authorization object determination unit 113 gives authorization is for an application installed in the communication apparatus 201. As an example, when the status information indicates access from inside the house, a private API is determined. The object accessed by the application of the communication apparatus 201 is the private API or the public API, and it is determined which access is granted. When the private API is determined, this means that the communication device 201 directly accesses the private API of the target device 301 (that is, the communication device 201 transmits a resource use request to the target device 301). In the case of a public API, the access proxy unit 116 receives access to the public API from the communication apparatus 201, and the access proxy unit 116 transmits a resource use request to the target device 301. It is assumed that a method for the access proxy unit 116 to use the resource of the target device 301 is determined in advance. A dedicated API may be prepared, or data including the URL of the private API may be transmitted to the target device, and the target device may internally interpret and execute the URL of the private API included in the data. .

以下、具体的な事例に基づき、本通信システムの動作を説明する。説明の前に、ユーザ行動の想定シナリオと、通信システムの前提条件について説明する。   The operation of this communication system will be described below based on specific examples. Before the description, an assumed scenario of user behavior and preconditions of the communication system will be described.

<想定シナリオ>
ユーザが、宅外からスマートフォン(通信装置201)に搭載されたテレビリモコンアプリケーション(以降、クライアントと呼ぶ)を操作し、自宅のテレビ(対象機器301)の番組録画予約を行う。続いて、ユーザは、帰宅後に当該テレビリモコンアプリケーションでテレビの電源ONし、チャンネルを切り替える。このとき、Web上のテレビリモコンサービスを提供するサーバ(アクセス認可装置101)は、ユーザが宅外にいるときはパブリックAPIを、ユーザが宅内にいるときは、プライベートAPIを利用するように、使用するAPIを自動的に切り換えるように制御する。この制御により、ユーザが番組録画予約を行うときは通信装置201はパブリックAPIにアクセスし、チャンネル切り替えを行うときはプライベートAPIにアクセスする。このようなAPIの切り替えは、宅外から宅内への移動を契機として自動的に実行される。
<Assumed scenario>
A user operates a TV remote control application (hereinafter referred to as a client) installed in a smartphone (communication device 201) from outside the house to make a program recording reservation for the home TV (target device 301). Subsequently, after returning home, the user turns on the TV with the TV remote control application and switches the channel. At this time, the server (access authorization device 101) that provides the TV remote control service on the Web is used so that the public API is used when the user is outside the home and the private API is used when the user is inside the home. The API to be automatically switched is controlled. With this control, the communication apparatus 201 accesses the public API when the user makes a program recording reservation, and accesses the private API when switching the channel. Such API switching is automatically executed in response to movement from outside the house to the house.

<前提条件>
・スマートフォン(通信装置201)上のリモコンアプリケーション(クライアント)は、OAuthの標準規格に従い、テレビリモコンサービスを提供するサーバ(アクセス認可装置101)から発行されたクライアント識別子(client_id)とクライアント秘密情報(client_secret)を保持している。この発行は、特定リソースへのアクセス(取得と変更)を行うクライアントを、クライアントの開発者が、アクセス認可装置101(の管理者)に登録申請し、アクセス認可装置101の管理者の承諾を経て実行される。登録、許諾、発行は、電子的に自動で行われることが一般的であるが、本実施形態では、この発行方法については規定しない。なお、特定リソースは、本実施形態では、テレビ(対象機器301)の状態(status)、および録画予約(reserved_programs)である。
・アクセス認可装置101側にも、クライアント認証用にこのclient_id、client_secret(図示せず)が登録されている。
・アクセス認可装置101の対象機器情報記憶部118には、対象機器301の外部IPアドレス等が、対象機器301の識別情報(デバイス識別子:device_id)と共に記憶されている(図3参照)。本実施形態では、この登録手法については規定しない。手動でデータベースに登録されていてもよいし、対象機器301(テレビ)がアクセス認可装置101と通信を行って、自動的に登録するようにしてもよい。
・通信装置201のユーザは、対象機器301の所有者であり、テレビリモコンサービスを提供するサーバ(アクセス認可装置101)で、予めユーザアカウント(user_id, user_password)を作成している。なお、ユーザID(user_id)は、トークン記憶部117においてトークンに関連づけられて登録されている(図2参照)。
・アクセス認可装置101上に、ユーザと、ユーザが所有する対象機器301(テレビ)が対応付けられている。この対応付けの方法も様々な実現形態が考えられるが、本実施形態ではその方法を規定しない。トークン記憶部117には、このユーザと対象機器301との対応付けが、ユーザID(user_id)と対象機器ID(device_id)との対応付けにより登録されている。
<Prerequisites>
The remote control application (client) on the smartphone (communication device 201) conforms to the OAuth standard, and the client identifier (client_id) and client secret information (client_secret) issued from the server (access authorization device 101) that provides the TV remote control service ). In this issuance, the client developer applies to the access authorization device 101 (administrator) for registration of a client that accesses (acquires and changes) a specific resource, and passes through the approval of the administrator of the access authorization device 101. Executed. Registration, permission, and issuance are generally performed automatically electronically, but this issuance method is not defined in this embodiment. In this embodiment, the specific resources are the status (status) of the television (target device 301) and the recording reservation (reserved_programs).
The client_id and client_secret (not shown) are registered on the access authorization apparatus 101 side for client authentication.
The target device information storage unit 118 of the access authorization apparatus 101 stores the external IP address of the target device 301 and the identification information (device identifier: device_id) of the target device 301 (see FIG. 3). In this embodiment, this registration method is not defined. It may be manually registered in the database, or the target device 301 (television) may communicate with the access authorization device 101 and automatically register.
The user of the communication device 201 is the owner of the target device 301 and has created a user account (user_id, user_password) in advance on a server (access authorization device 101) that provides a TV remote control service. The user ID (user_id) is registered in the token storage unit 117 in association with the token (see FIG. 2).
On the access authorization device 101, the user and the target device 301 (television) owned by the user are associated with each other. There are various ways of realizing this association method, but this embodiment does not define the method. In the token storage unit 117, the association between the user and the target device 301 is registered by the association between the user ID (user_id) and the target device ID (device_id).

<本実施形態の通信シーケンス>
図4は、本実施形態に係る通信システムにおける対象機器301、通信装置201およびアクセス認可装置101間で行われる通信シーケンスを示す。図5は、図4に続く通信シーケンスを示す。図4および図5における各数字はステップの番号を表す。
<Communication sequence of this embodiment>
FIG. 4 shows a communication sequence performed between the target device 301, the communication device 201, and the access authorization device 101 in the communication system according to the present embodiment. FIG. 5 shows a communication sequence following FIG. Each numeral in FIGS. 4 and 5 represents a step number.

[ステップ1]ユーザが、通信装置201上のクライアントを立ちあげ、所望の番組の録画予約(リソース利用)を行う。このとき、クライアントは、未だアクセストークンを取得していないので、ユーザに認可画面を表示し、許可画面にはクライアントが対象機器301のリソース利用を求めている旨と、許諾ボタンおよびキャンセルボタンとを表示する。許可画面にユーザが宅内および宅外のいずれにいるか(第1ネットワーク501および第2ネットワーク601のどちらに接続されているか)を区別する情報を表示してもよい。 [Step 1] A user starts up a client on the communication apparatus 201 and makes a recording reservation (resource use) for a desired program. At this time, since the client has not yet acquired an access token, an authorization screen is displayed to the user, and the permission screen indicates that the client requests the use of resources of the target device 301, and a permission button and a cancel button. indicate. Information for distinguishing whether the user is inside or outside the house (connected to the first network 501 or the second network 601) may be displayed on the permission screen.

[ステップ2]ユーザが、許可画面内の認可ボタンを押下する。本実施形態では、クライアントが認可画面を生成しているが、アクセス認可装置101に認可要求を送信し、アクセス認可装置101が認可画面を応答する方法を採ってもよい。この場合、アクセス認可装置101から応答された許可画面を、通信装置201で表示する。 [Step 2] The user presses the authorization button in the permission screen. In this embodiment, the client generates the authorization screen. However, a method may be adopted in which an authorization request is transmitted to the access authorization apparatus 101 and the access authorization apparatus 101 responds with the authorization screen. In this case, the permission screen returned from the access authorization device 101 is displayed on the communication device 201.

[ステップ3]クライアントは、ユーザの許諾を受けて、アクセス認可装置101のトークン発行部112にアクセストークン発行要求(リソースの許可要求)を送信する。このとき、アクセストークン発行要求は、一実現形態としては、client_id、client_secret、user_id、user_password、および、要求するAPIに関する情報である認可範囲情報(認可対象情報)を含む。認可範囲情報は、一例として、192.168.11.19 /v1/status, および192.168.11.19 /v1/reserved_programを含む。「192.168.11.19 /v1/」をアクセス認可装置で把握している場合、認可範囲情報はstatus とreserved_programを含んでもよい。 [Step 3] Upon receiving permission from the user, the client transmits an access token issue request (resource permission request) to the token issuing unit 112 of the access authorization apparatus 101. At this time, the access token issuance request includes client_id, client_secret, user_id, user_password, and authorization range information (authorization target information) that is information related to the requested API, as an implementation form. The authorization range information includes 192.168.11.19/v1/status and 192.168.11.19/v1/reserved_program as an example. When “192.168.11.19/v1/” is known by the access authorization device, the authorization range information may include status and reserved_program.

user_idとuser_passwordは、通信装置201がユーザに入力画面(ステップ1のユーザ認可画面でもよい)を表示し、その入力値を利用するようにしてもよいし、予め、通信装置201内に記憶しておき、これを利用するようにしてもよい。   For the user_id and user_password, the communication device 201 may display an input screen (or the user authorization screen in step 1) to the user and use the input value, or may be stored in the communication device 201 in advance. Alternatively, this may be used.

認可範囲情報は、アクセストークン発行要求に含めずに、予めクライアント識別子(client_id)に紐づけてアクセス認可装置101側で記憶しておいてもよい。なお、client_id, client_secret, user_id, user_passwordを含むアクセストークン発行要求は、OAuth2.0のリソースオーナーパスワードクレデンシャルグラントという承認方式(グラントタイプ)に則っている。本実施形態では、このグラントタイプに則ったシーケンスのみを記すが、これ以外のグラントタイプ(認可コード、インプリシットグラント、またはクライアントクレデンシャルグラント)に則ったシーケンスであってもよい。   The authorization range information may be stored in advance on the access authorization apparatus 101 side in association with the client identifier (client_id) without being included in the access token issue request. Note that an access token issuance request including client_id, client_secret, user_id, and user_password conforms to an authorization method (grant type) called OAuth 2.0 resource owner password credential grant. In this embodiment, only a sequence according to this grant type is described, but a sequence according to other grant types (authorization code, implicit grant, or client credential grant) may be used.

(ステップ4)トークン発行部112は、アクセストークン発行要求に含まれるclient_id, client_secretに基づき、当該クライアントが正規のクライアントであることを認証する。正規のクライアントとは、アクセス認可装置101に事前に登録および承認されたクライアントのことである。 (Step 4) The token issuing unit 112 authenticates that the client is a regular client based on client_id and client_secret included in the access token issue request. A regular client is a client that has been registered and approved in advance in the access authorization apparatus 101.

(ステップ5)トークン発行部112は、user_id, user_passwordに基づき、ユーザが正規のユーザであることを認証する。正規のユーザとは、アクセス認可装置101に事前に登録および承認されたユーザのことである。アクセス認可装置101ではユーザと対象機器301とが予め関連づけて登録されているため、認証の結果として、ユーザの所有対象機器301が判明する。ここでは、ユーザの所有対象機器301は、テレビ(device_id=xyz)である。 (Step 5) The token issuing unit 112 authenticates that the user is a regular user based on user_id and user_password. An authorized user is a user who has been registered and approved in advance in the access authorization device 101. In the access authorization device 101, the user and the target device 301 are registered in advance in association with each other, and therefore the user's possession target device 301 is determined as a result of authentication. Here, the user-owned target device 301 is a television (device_id = xyz).

(ステップ6)状態判定部114は、アクセストークン発行要求の送信元IPアドレスを取得し、この送信元IPアドレスを、対象機器情報記憶部118における当該テレビに対応するIPアドレス(図3参照)と比較する。当該テレビに対応するIPアドレスは、トークン記憶部においてユーザに関連づけられた機器(テレビ)を特定し、当該テレビのIPアドレスを、対象機器情報記憶部118から特定することで行うことができる。これらが異なっていれば、ユーザのアクセスは宅外アクセスであり、同じであれば宅内アクセスであると判定する。ここでは、宅外アクセスと判定される。 (Step 6) The state determination unit 114 acquires the transmission source IP address of the access token issue request, and uses this transmission source IP address as the IP address (see FIG. 3) corresponding to the television in the target device information storage unit 118. Compare. The IP address corresponding to the television can be determined by specifying the device (television) associated with the user in the token storage unit and specifying the IP address of the television from the target device information storage unit 118. If they are different, it is determined that the user's access is an out-of-home access, and if they are the same, the access is in-home. Here, it is determined that the access is outside the home.

(ステップ7)認可対象決定部113は、状態判定部114の判定結果と、ユーザに関連づけられた対象機器301(device_id=xyz)に基づき、パブリックAPI(api.tvcontroller.example.com/v1/devices/xyz/statusと、api.tvcontroller.example.com/v1/devices/xyz/reserved_program)を認可対象として決定する。具体的に、図2のトークン記憶部117に記憶された情報において、ユーザ(この例ではaliceとする)と対象機器301(xyz)とに関連づけられたパブリックAPIおよびプライベートAPIのうち、宅内アクセスの判定結果から、パブリックAPIを決定する。図2の情報においてパブリックAPIとプライベートAPIの区別は、許可対象情報(API情報)の記述自体から行ってもよいし(例えば許可対象情報にプライベートIPアドレスが含まれていればプライベートAPIと判断するなど)、あるいは、パブリックAPIとプライベートAPIを区別するための識別情報を別途付与し、この識別情報に基づいて行ってもよい。 (Step 7) The authorization target determining unit 113 uses the public API (api.tvcontroller.example.com/v1/devices) based on the determination result of the state determination unit 114 and the target device 301 (device_id = xyz) associated with the user. / xyz / status and api.tvcontroller.example.com/v1/devices/xyz/reserved_program) are determined as authorization targets. Specifically, in the information stored in the token storage unit 117 in FIG. 2, out of the public API and private API associated with the user (which is alice in this example) and the target device 301 (xyz), A public API is determined from the determination result. In the information of FIG. 2, the public API and the private API may be distinguished from the description of the permission target information (API information) itself (for example, if the permission target information includes a private IP address, it is determined as a private API). Etc.) Or, identification information for distinguishing between public API and private API may be separately added, and this may be performed based on this identification information.

(ステップ8)トークン発行部112は、認可対象決定部113の決定に基づき、パブリックAPI用のアクセストークンを発行し、発行したアクセストークンを含むアクセストークン応答をクライアントに送信する。発行されたアクセストークンは、トークン記憶部117に記憶される(図2の1行目の「アクセストークン」の列)。本実施形態では、トークン発行部112は、発行したアクセストークンに有効期限(図2の1行目の「有効期限」の列」)を設け、さらに、アクセストークンの更新用に用いるリフレッシュトークン(図2の1行目の「リフレッシュトークン」の列」)をあわせて発行する。このリフレッシュトークンも、クライアントに送信するアクセストークン応答に含める。なお、アクセストークン応答に、パブリックAPI情報を含めてもよいし、クライアント側でパブリックAPI情報を事前に把握するようにしてもよい。 (Step 8) Based on the determination by the authorization object determining unit 113, the token issuing unit 112 issues an access token for public API, and transmits an access token response including the issued access token to the client. The issued access token is stored in the token storage unit 117 (column of “access token” in the first row in FIG. 2). In the present embodiment, the token issuing unit 112 provides an expiration date (“expiration date” column in the first row in FIG. 2) for the issued access token, and further uses a refresh token (FIG. 2) “Refresh token” column in the first row)). This refresh token is also included in the access token response sent to the client. Note that public API information may be included in the access token response, or the public API information may be grasped in advance on the client side.

リフレッシュトークンは、アクセストークンよりも長い有効期限を設けてもよい。アクセストークンが期限切れした場合や、後述する通信装置201の状態(宅内か宅外か)が変化する等してトークン検証が失敗した場合には、クライアントは、このリフレッシュトークンを提示して、新しいアクセストークンの発行を要求する。リフレッシュトークンを利用することで、再度ユーザ認証等から処理をやり直す必要がない利点がある。なお、後述するステップ18に記すように、リフレッシュトークンを用いない形態も可能である。   The refresh token may have a longer expiration date than the access token. When the access token expires or the token verification fails due to a change in the state of the communication device 201 (in-home or out-of-home), which will be described later, the client presents this refresh token and performs a new access Request issuance of a token. By using the refresh token, there is an advantage that it is not necessary to start the process again from the user authentication or the like. In addition, as described in Step 18 described later, a form that does not use a refresh token is also possible.

(ステップ9)クライアントは、アクセス認可装置101から受信したアクセストークン応答に含まれるパブリックAPI用のアクセストークンとリフレッシュトークンを取得する。クライアントは、アクセストークンを含む録画予約要求(リソース利用要求)を、パブリックAPI(アクセス代行部116)に送信する。具体的には、パブリックAPIのURLhttps://api.tvcontroller.example.com/v1/devices/xyz/reserved_programsに対して、前述したメッセージAを送信する。なお、前述したメッセージAの例では、アクセストークン等の表記は省略されている。 (Step 9) The client obtains an access token and a refresh token for public API included in the access token response received from the access authorization apparatus 101. The client transmits a recording reservation request (resource use request) including an access token to the public API (access proxy unit 116). Specifically, the above-described message A is transmitted to the public API URL https://api.tvcontroller.example.com/v1/devices/xyz/reserved_programs. In the example of the message A described above, the notation such as an access token is omitted.

(ステップ10)
アクセス代行部116は、パブリックAPI用のアクセストークンを含む録画予約要求を受信する。このとき、トークン検証部115は、録画予約要求に含まれるアクセストークンが、パブリックAPI用に発行された有効なものであることを、トークン記憶部117を参照して確認する。すなわち、録画予約要求に含まれるアクセストークンがトークン記憶部117に存在し、かつ有効期限内であることを確認する。
(Step 10)
The access proxy unit 116 receives a recording reservation request including an access token for public API. At this time, the token verification unit 115 refers to the token storage unit 117 to confirm that the access token included in the recording reservation request is a valid one issued for public API. That is, it is confirmed that the access token included in the recording reservation request exists in the token storage unit 117 and is within the expiration date.

(ステップ11)状態判定部114は、ステップ6と同様に、録画予約要求の送信元IPアドレスを、対象機器情報記憶部118における当該テレビ(例えばパブリックAPIのURLの「xyz」から特定)に対応するIPアドレス(図3参照)と比較することで、宅外アクセスか宅外アクセスかを判定する。ここでは両者が一致しないため、宅外アクセスと判断する。トークン検証部115は、状態判定部114の判定結果に基づき、録画予約要求に含まれているアクセストークンが宅外からの録画予約要求用に発行された正当なものと判定する。 (Step 11) Similarly to step 6, the state determination unit 114 corresponds to the transmission IP address of the recording reservation request corresponding to the television in the target device information storage unit 118 (for example, specified from “xyz” of the public API URL). It is determined whether the access is out-of-home access or out-of-home access by comparing with the IP address (see FIG. 3). Here, since both do not match, it is determined that the access is outside the home. Based on the determination result of the state determination unit 114, the token verification unit 115 determines that the access token included in the recording reservation request is valid for the recording reservation request from outside the home.

(ステップ12)アクセス代行部116は、リソース利用要求である録画予約要求を、対象機器301に送信する。送信された録画予約要求は第1ネットワーク501、中継装置401および第2ネットワーク502を介して、対象機器301で受信される。 (Step 12) The access proxy unit 116 transmits a recording reservation request, which is a resource use request, to the target device 301. The transmitted recording reservation request is received by the target device 301 via the first network 501, the relay device 401, and the second network 502.

(ステップ13)対象機器301は、アクセス認可装置101から録画予約要求を受信し、録画予約要求に基づき録画予約を実行する。対象機器301は録画予約を実行すると、録画予約を完了報告をアクセス認可装置101に送信する。アクセス認可装置101は、録画予約の完了報告を対象機器301から受信する。アクセス代行部116は、要求された録画予約が完了したことを示す応答(パブリックAPIアクセス応答)を通信装置201に返す。 (Step 13) The target device 301 receives the recording reservation request from the access authorization apparatus 101, and executes the recording reservation based on the recording reservation request. When the target device 301 executes the recording reservation, the target device 301 transmits a recording reservation completion report to the access authorization apparatus 101. The access authorization device 101 receives a recording reservation completion report from the target device 301. The access proxy unit 116 returns a response (public API access response) indicating that the requested recording reservation has been completed to the communication apparatus 201.

(ステップ14)ユーザが、宅外から宅内に移動し、通信装置201に搭載されたクライアントを用いて、テレビのチャンネル切り替えを行う。このとき、宅外で使われていた携帯キャリア通信(3GやLTE)から、宅内のWiFiに通信が切り替わったとする。すなわち、通信装置201の接続先が第1ネットワーク501から第2ネットワーク601に切り替わったとする。 (Step 14) The user moves from outside the house to the house, and uses the client installed in the communication device 201 to switch the TV channel. At this time, it is assumed that communication is switched from mobile carrier communication (3G or LTE) used outside the house to WiFi in the house. That is, it is assumed that the connection destination of the communication apparatus 201 is switched from the first network 501 to the second network 601.

(ステップ15)クライアントは、アクセス代行部116のパブリックAPIに対して、パブリックAPI用のアクセストークンを含むチャンネル切り替え要求(リソース利用要求)を送信する。具体的には、パブリックAPIのURLhttps://api.tvcontroller.example.com/v1/devices/xyz/statusに対して、前述したメッセージBを送信する。なお、前述したメッセージBの例では、アクセストークン等の表記は省略されている。 (Step 15) The client transmits a channel switching request (resource use request) including an access token for the public API to the public API of the access proxy unit 116. Specifically, the above-described message B is transmitted to the public API URL https://api.tvcontroller.example.com/v1/devices/xyz/status. In the example of the message B described above, the notation such as an access token is omitted.

(ステップ16)アクセス代行部116は、アクセストークンを含むチャンネル切り替え要求を受信する。このとき、トークン検証部115は、ステップ10と同様、アクセストークンがパブリックAPI用に発行された有効なものであることを、トークン記憶部117を参照して確認する。 (Step 16) The access proxy unit 116 receives a channel switching request including an access token. At this time, the token verification unit 115 confirms that the access token is a valid one issued for the public API with reference to the token storage unit 117 as in Step 10.

(ステップ17)状態判定部114は、ステップ11と同様に、チャンネル切り替え要求の送信元IPアドレスを、対象機器情報記憶部118における当該テレビ(例えばパブリックAPIのURLの「xyz」から特定)に対応するIPアドレス(図3参照)と比較することで、宅外アクセスか宅外アクセスかを判定する。ここでは両者が一致するため、宅内アクセスと判断する。トークン検証部115は、状態判定部114の判定結果に基づき、認可エラーを判断する。アクセス代行部116は、これを受けて、パブリックAPIへの、宅内(中継装置401配下の第2ネットワーク601)からのアクセスを拒絶し、認可エラー応答を送信する。 (Step 17) As in step 11, the state determination unit 114 corresponds to the transmission source IP address of the channel switching request for the television in the target device information storage unit 118 (for example, specified from “xyz” of the public API URL). It is determined whether the access is out-of-home access or out-of-home access by comparing with the IP address (see FIG. 3). Here, since both coincide, it is determined that the access is in-home. The token verification unit 115 determines an authorization error based on the determination result of the state determination unit 114. In response to this, the access proxy unit 116 rejects access from the home (second network 601 under the relay device 401) to the public API, and transmits an authorization error response.

(ステップ18)通信装置201に搭載されたクライアントは認可エラー応答を受信すると、アクセストークン発行要求を生成してトークン発行部112に送信する。このアクセストークン発行要求は、ステップ8で発行されたリフレッシュトークンを含む。バリエーションとしては、リフレッシュトークンは使わず、ステップ3と同様、再度、新規のアクセストークン発行要求を送信する方法もある。 (Step 18) Upon receiving the authorization error response, the client installed in the communication apparatus 201 generates an access token issue request and transmits it to the token issuing unit 112. This access token issue request includes the refresh token issued in Step 8. As a variation, there is a method in which a refresh token is not used and a new access token issuance request is transmitted again as in step 3.

(ステップ19)トークン検証部115は、トークン発行要求に含まれるリフレッシュトークンを取得し、取得したリフレッシュトークンが、トークン記憶部117に登録されているかを確認する(なお、この時点では図2の2行目のアクセストークンおよびリフレッシュトークンは登録されていなくてよい)。登録されていることから、当該リフレッシュトークンが、正当なリフレッシュトークンであると判断する。このとき、リフレッシュトークンの発行対象である対象機器301のID、すなわちdevice_id(=xyz)をトークン記憶部117から取得する。 (Step 19) The token verification unit 115 acquires the refresh token included in the token issuance request, and confirms whether the acquired refresh token is registered in the token storage unit 117 (at this time, 2 in FIG. 2). The access token and refresh token on the line need not be registered). Since it is registered, it is determined that the refresh token is a valid refresh token. At this time, the ID of the target device 301 for which a refresh token is issued, that is, device_id (= xyz) is acquired from the token storage unit 117.

(ステップ20)ステップ17と同様、状態判定部114は、トークン発行要求の送信元IPアドレスを、対象機器情報記憶部118における当該テレビ(xyz)に対応するIPアドレス(図3参照)と比較することで、宅外アクセスか宅外アクセスかを判定する。ここでは、両者が一致するため、宅内アクセスであると判定する。 (Step 20) As in step 17, the state determination unit 114 compares the transmission source IP address of the token issuance request with the IP address (see FIG. 3) corresponding to the television (xyz) in the target device information storage unit 118. Thus, it is determined whether the access is out-of-home access or out-of-home access. Here, since both coincide, it is determined that the access is in-home.

(ステップ21)認可対象決定部113は、状態判定部114の判定結果と、ユーザに関連づけられた対象機器301(device_id=xyz)に基づき、対象機器301に搭載されたプライベートAPI(192.168.11.19 /v1/status, reserved_program)を、通信装置201のアクセス認可対象に決定する。 (Step 21) Based on the determination result of the state determination unit 114 and the target device 301 (device_id = xyz) associated with the user, the authorization target determination unit 113 uses the private API (192.168.11.19/ v1 / status, reserved_program) is determined as an access authorization target of the communication apparatus 201.

(ステップ22)トークン発行部112は、認可対象決定部113の決定に基づき、プライベートAPI用のアクセストークンを発行する。発行されたアクセストークンは、トークン記憶部117に記憶される(図2の2行目の「アクセストークン」の列)。この際、パブリックAPI用のリフレッシュトークンと同じ値のリフレッシュトークンを、プライベートAPI用のアクセストークンに対するリフレッシュトークンとしてトークン記憶部117に記憶する(図2の2行目の「リフレッシュトークン」の列)。また、トークン発行部112は、図2のトークン記憶部117におけるプライベートAPI情報(認可対象情報)を取得し、アクセストークンとプライベートAPI情報等を含むアクセストークン応答を生成する。トークン発行部は、アクセストークン応答を通信装置201に送信する。なお、リフレッシュトークンの値は、パブリックAPI用のリフレッシュトークンと異なってもよい。 (Step 22) The token issuing unit 112 issues an access token for private API based on the determination by the authorization target determining unit 113. The issued access token is stored in the token storage unit 117 (column of “access token” in the second row in FIG. 2). At this time, a refresh token having the same value as the refresh token for public API is stored in the token storage unit 117 as a refresh token for the access token for private API (column “refresh token” in the second row in FIG. 2). Further, the token issuing unit 112 acquires private API information (authorization target information) in the token storage unit 117 in FIG. 2, and generates an access token response including an access token, private API information, and the like. The token issuing unit transmits an access token response to the communication device 201. Note that the value of the refresh token may be different from the refresh token for public API.

(ステップ23)通信装置201に搭載されたクライアントは、アクセストークン応答に含まれるアクセストークンとプライベートAPI情報を取得し、対象機器301のプライベートAPIに、当該取得したアクセストークンを含むチャンネル切り替え要求(リソース利用要求)を送信する(すなわち、プライベートAPIアクセスを実行する)。なお、通信装置201で事前にプライベートAPI情報を把握している場合は、アクセス認可装置101から送信するアクセストークン応答にプライベートAPI情報を含めなくてもよい。この場合、アクセス認可装置101でプライベートAPI情報を把握しない構成にしてもよい。 (Step 23) The client installed in the communication device 201 acquires the access token and private API information included in the access token response, and the channel switching request (resource) including the acquired access token in the private API of the target device 301. Use request) (ie, execute private API access). When the communication device 201 knows the private API information in advance, it is not necessary to include the private API information in the access token response transmitted from the access authorization device 101. In this case, the access authorization apparatus 101 may be configured not to grasp the private API information.

(ステップ24)対象機器301のプライベートAPIは、アクセストークンを含むチャンネル切り替え要求を受信する。対象機器301のプライベートAPIは、チャンネル切り替え要求に含まれるアクセストークンを取得し、当該アクセストークンを含むトークン検証要求を生成して、アクセス認可装置101に送信する。 (Step 24) The private API of the target device 301 receives a channel switching request including an access token. The private API of the target device 301 acquires an access token included in the channel switching request, generates a token verification request including the access token, and transmits the token verification request to the access authorization apparatus 101.

(ステップ25)アクセス認可装置101の通信部111は、対象機器301から送信されるトークン検証要求を受信する。トークン検証部115は、トークン検証要求に含まれるアクセストークンが、対象機器301のプライベートAPI用に発行された有効なものであることを、トークン記憶部117を参照して確認する。当該アクセストークンと同じ値がトークン記憶部117において当該対象機器301に対して記憶されており、有効期限内であるため、有効であると判断できる。なお、トークン検証部115は、トークン検証要求の送信元が対象機器301(device_id=xyz)であることは、トークン検証要求に対象機器IDの“xyz”を含め、これを検出することで把握してもよい。または、Websocketで対象機器301とアクセス認可装置101との接続が維持されている場合に、当該接続を介して送信される要求の送信元機器が常に対象機器301(device_id=xyz)であると判断する仕組みにしてもよい。ここで述べた以外の方法で判断してもよい。 (Step 25) The communication unit 111 of the access authorization device 101 receives the token verification request transmitted from the target device 301. The token verification unit 115 refers to the token storage unit 117 to confirm that the access token included in the token verification request is a valid one issued for the private API of the target device 301. Since the same value as the access token is stored in the token storage unit 117 for the target device 301 and is within the expiration date, it can be determined to be valid. The token verification unit 115 recognizes that the transmission source of the token verification request is the target device 301 (device_id = xyz) by including “xyz” of the target device ID in the token verification request and detecting this. May be. Alternatively, when the connection between the target device 301 and the access authorization device 101 is maintained using Websocket, it is determined that the source device of the request transmitted via the connection is always the target device 301 (device_id = xyz). You may make it a mechanism to do. You may judge by methods other than what was described here.

(ステップ26)状態判定部114が、トークン検証要求の送信元IPアドレスを、対象機器情報記憶部118における当該テレビ(xyz)に対応するIPアドレス(図3参照)と比較することで、通信装置201のアクセス(すなわちユーザのアクセス)が、宅外アクセスか宅外アクセスかを判定する。ここでは、両者が一致するため、宅内アクセスであると判定する。トークン検証要求に含まれる送信元IPアドレスは、通信装置201の第2ネットワーク601との接続状態を特定するための情報の一例である。トークン検証部115は、状態判定部114の判定結果(宅内アクセス)から、クライアントからの対象機器301へのアクセスは正当なアクセスであると判定(すなわちユーザはアクセス認可装置101で認証および認可を経て、宅内の対象機器301のプライベートAPIにアクセスしようとしていると判断)し、その旨の検証結果を表す応答を対象機器301に送信する。 (Step 26) The state determination unit 114 compares the transmission source IP address of the token verification request with the IP address (see FIG. 3) corresponding to the television (xyz) in the target device information storage unit 118, so that the communication device It is determined whether the access 201 (that is, user access) is out-of-home access or out-of-home access. Here, since both coincide, it is determined that the access is in-home. The transmission source IP address included in the token verification request is an example of information for specifying the connection state of the communication apparatus 201 with the second network 601. The token verification unit 115 determines from the determination result (in-home access) of the state determination unit 114 that the access from the client to the target device 301 is a legitimate access (that is, the user is authenticated and authorized by the access authorization device 101). And determines that it is going to access the private API of the target device 301 in the home), and transmits a response indicating the verification result to the target device 301.

(ステップ27)対象機器301は、アクセス認可装置101の検証結果から、通信装置201からのプライベートAPIアクセスで指示されたチャンネル切り替えを実行してよいと判断し、当該チャンネル切り替えを実行する。対象機器301は、チャンネル切り替えを実行した旨を表す応答(プライベートAPIアクセス応答)を通信装置201に送信する。 (Step 27) From the verification result of the access authorization device 101, the target device 301 determines that the channel switching instructed by the private API access from the communication device 201 may be executed, and executes the channel switching. The target device 301 transmits a response (private API access response) indicating that channel switching has been executed to the communication device 201.

図6は、アクセス認可装置101が通信装置201からトークン発行要求を受信した場合に行う処理のフローチャートである。前述した図4および図5のシーケンスでは、ステップ3とステップ18でトークン発行要求を通信装置201から受信している。   FIG. 6 is a flowchart of processing performed when the access authorization device 101 receives a token issue request from the communication device 201. 4 and FIG. 5, the token issuance request is received from the communication apparatus 201 in steps 3 and 18.

トークン発行要求を受信すると、トークン発行要求にリフレッシュトークンが含まれているかを判断する(ステップ31)。   When the token issue request is received, it is determined whether the token issue request includes a refresh token (step 31).

リフレッシュトークンが含まれていない場合、クライアント認証(ステップ32)およびユーザ認証(ステップ33)を行う。クライアント認証およびユーザ認証の詳細は前述した通りである。いずれかの認証が失敗すれば、通信装置201に認証エラー応答を送信して処理を終了する(ステップ39)。両方の認証が成功した場合は、通信装置201の状態判定(ユーザが宅内にいるか宅外にいるかの判定)を行う(ステップ34)。判定方法の詳細は前述した通りである。状態判定の結果に応じて、パブリックAPIおよびプライベートAPIのいずれをアクセス認可対象にするかを決定し(ステップ35)、決定したAPIに対応するアクセストークンを生成する(ステップ36)。生成したアクセストークンは、API情報、および対象機器301およびユーザ等に関連づけて、トークン記憶部117に記憶する(ステップ37)。   If the refresh token is not included, client authentication (step 32) and user authentication (step 33) are performed. Details of client authentication and user authentication are as described above. If any authentication fails, an authentication error response is transmitted to the communication apparatus 201 and the process is terminated (step 39). When both authentications are successful, the state of the communication device 201 is determined (determination whether the user is in the house or outside the house) (step 34). The details of the determination method are as described above. According to the result of the state determination, it is determined which of the public API and the private API is to be subject to access authorization (step 35), and an access token corresponding to the determined API is generated (step 36). The generated access token is stored in the token storage unit 117 in association with the API information, the target device 301 and the user (step 37).

一方、トークン発行要求にリフレッシュトークンが含まれている場合は、リフレッシュトークンを検証する(ステップ38)。すなわち、当該リフレッシュトークンがトークン記憶部117に有効に登録されているかを判断する。有効に登録されている場合は、ステップ34の通信装置201の状態判定を行い、以降は上述したステップ35〜37を行う。リフレッシュトークンがトークン記憶部117に登録されていない、もしくは登録されているが有効期限が切れている場合は、通信装置201に認証エラー応答を送信して処理を終了する(ステップ39)。   On the other hand, if the token issuance request includes a refresh token, the refresh token is verified (step 38). That is, it is determined whether the refresh token is effectively registered in the token storage unit 117. If it is registered effectively, the state of the communication device 201 is determined in step 34, and thereafter, the above-described steps 35 to 37 are performed. If the refresh token is not registered in the token storage unit 117 or has been registered but the expiration date has expired, an authentication error response is transmitted to the communication apparatus 201 and the process is terminated (step 39).

本実施形態では、対象機器が宅内に1つある場合を示したが、複数の対象機器がある場合も同様にして実施可能である。このとき、対象機器ごとにパブリックAPI用およびプライベートAPI用のアクセストークンをそれぞれ発行してもよいし、それぞれ同じアクセストークンを複数の対象機器で用いてもよい。   In the present embodiment, the case where there is one target device in the house is shown, but the same can be implemented when there are a plurality of target devices. At this time, an access token for public API and private API may be issued for each target device, or the same access token may be used by a plurality of target devices.

また、本実施形態では、中継装置401が通信装置201とは別に存在したが、通信装置201が中継機能を備え、対象機器301が通信装置201の中継機能を利用して、アクセス認可装置101と通信してもよい。この場合も、通信装置201は、対象機器301と同じネットワークに接続されているといえる。   In this embodiment, the relay device 401 exists separately from the communication device 201, but the communication device 201 has a relay function, and the target device 301 uses the relay function of the communication device 201 to connect to the access authorization device 101. You may communicate. Also in this case, it can be said that the communication apparatus 201 is connected to the same network as the target device 301.

また、本実施形態ではアクセス認可装置は対象機器301とWebsocket等で常時通信コネクションを維持している状況を想定したが、通信装置201が第2ネットワーク602に接続されている(または接続可能な状態である)と判定された場合は、対象機器301との通信コネクションを切断してもよい。また、通信装置201が第2ネットワーク602に接続されていない(または接続不能な状態である)と判定された場合は、対象機器301との通信コネクションを再度設定してもよい。   In this embodiment, it is assumed that the access authorization device always maintains a communication connection between the target device 301 and Websocket, but the communication device 201 is connected to the second network 602 (or is in a connectable state). The communication connection with the target device 301 may be disconnected. When it is determined that the communication device 201 is not connected to the second network 602 (or is in a state where connection is not possible), the communication connection with the target device 301 may be set again.

以上、本実施形態によれば、アクセストークンの発行(ステップ4〜8、19〜22)、アクセストークンを利用したリソースアクセス(9〜12, 15〜17)、アクセストークンの検証(25〜26)において、通信装置201の状態(宅外か宅内か)に応じた処理を行う。具体的には、ユーザが宅外にいる場合には、パブリックAPIを利用し、宅内にいる場合には、必ずプライベートAPIを利用するようクライアントに強制することができる。このとき、ユーザはAPIの切り替えの都度、再認可を行う必要はなく、ユーザが知らない間に、利用するAPIが切り替わる。ユーザは、宅外からのAPIアクセスを行う場合にだけ、インターネット(第1ネットワーク501)上のサーバ(アクセス認可装置101)を利用するので、サーバに残る通信ログを必要最小限でき、かつ、可能な限りホームネットワーク(第2ネットワーク601)での直接通信を利用することで、リソース利用に要する通信遅延を短くできる。   As described above, according to the present embodiment, the access token issuance (steps 4 to 8 and 19 to 22), the resource access using the access token (9 to 12 and 15 to 17), and the access token verification (25 to 26). In FIG. 5, processing is performed according to the state of the communication device 201 (external or in-home). Specifically, it is possible to force the client to use a public API when the user is outside the home and to use a private API whenever the user is at home. At this time, the user does not need to reauthorize each time the API is switched, and the API to be used is switched while the user does not know. Since the user uses the server (access authorization device 101) on the Internet (first network 501) only when performing API access from outside the house, the communication log remaining on the server can be minimized and possible. By using direct communication in the home network (second network 601) as much as possible, communication delay required for resource use can be shortened.

以下、本実施形態のバリエーションについて説明する。   Hereinafter, variations of the present embodiment will be described.

<通信シーケンスのバリエーション(1)>
図5のステップ18〜22ではアクセストークンを発行し直しているが、アクセストークンを発行し直さないシーケンスも可能である。以下のこの場合のシーケンスの変更点を説明する。
<Variation of communication sequence (1)>
In steps 18 to 22 in FIG. 5, the access token is reissued, but a sequence in which the access token is not reissued is also possible. The sequence changes in this case will be described below.

図4のステップ1の認可画面で、宅内・宅外両用のアクセストークンの認可をユーザに求めるようにする。   On the authorization screen in step 1 of FIG. 4, the user is requested to authorize access tokens for both inside and outside the house.

ステップ8のトークン発行で、プライベートAPI、パブリックAPI両用のアクセストークンを発行する。発行されるアクセストークンは、図2の1行目、2行目の認可対象情報を両方に対して有効である。   By issuing a token in step 8, an access token for both private API and public API is issued. The access token to be issued is valid for both the authorization object information in the first and second lines in FIG.

ステップ17でエラー応答とせずに、プライベートAPIへのリダイレクト応答を通信装置201に送信する。このリダイレクト応答にはプライベートAPI情報を含める。リダイレクト応答を受信した通信装置201は、リダイレクト応答に含まれるプライベートAPI情報に基づき、図5のステップ23の動作を実行する。これによりステップ18〜22の動作は不要となる。   In step 17, a redirect response to the private API is transmitted to the communication device 201 without making an error response. This redirect response includes private API information. The communication apparatus 201 that has received the redirect response executes the operation of Step 23 in FIG. 5 based on the private API information included in the redirect response. As a result, the operations in steps 18 to 22 become unnecessary.

<通信シーケンスのバリエーション(2)>
図4および図5のシーケンスでは、トークン検証(トークンの有効性検証)および状態判定の順で処理を行っている(ステップ10−11、ステップ16−17、ステップ19−20、ステップ25−26)が、これは実装依存の部分であり、状態判定を先に行っても構わない。
<Variation of communication sequence (2)>
In the sequence of FIG. 4 and FIG. 5, processing is performed in the order of token verification (token validity verification) and state determination (step 10-11, step 16-17, step 19-20, step 25-26). However, this is an implementation-dependent part, and the state determination may be performed first.

<通信シーケンスのバリエーション(3)>
図5のステップ27の後、ユーザが宅内から宅外に移動して、別途録画予約を行う場合のシーケンスを、以下にステップ28〜31として示す。
<Variation of communication sequence (3)>
A sequence in the case where the user moves from the inside of the house to the outside of the house after the step 27 in FIG.

(ステップ28)ユーザが、宅内から宅外に移動する。この時、通信装置201は、通信をWiFiから、3GないしLTEなどのモバイル広域通信に切り替える。すなわち、通信装置201は、通信の接続先を第2ネットワーク601から第1ネットワーク501に切り換える。 (Step 28) The user moves from inside the house to outside the house. At this time, the communication apparatus 201 switches communication from WiFi to mobile wide area communication such as 3G to LTE. That is, the communication apparatus 201 switches the communication connection destination from the second network 601 to the first network 501.

(ステップ29)ステップ23と同様、クライアントは、宅内用のアクセストークンを用いて、対象機器301のプライベートAPIに録画予約要求を送信する。 (Step 29) Similar to step 23, the client transmits a recording reservation request to the private API of the target device 301 using the home access token.

(ステップ30)プライベートAPIへのアクセスが失敗する。すなわち、通信装置201は第1ネットワーク501に接続されているため、第2ネットワーク601内の対象機器301のプライベートAPIへアクセスするための通信は失敗する(タイムアウトする)。このため、通信装置201のクライアントは、第1ネットワーク501を介して、アクセス認可装置101のトークン発行部112にトークン発行要求を送信する。このトークン発行要求には、プライベートAPI用のリフレッシュトークンを含める。 (Step 30) Access to the private API fails. That is, since the communication apparatus 201 is connected to the first network 501, communication for accessing the private API of the target device 301 in the second network 601 fails (timeout). For this reason, the client of the communication device 201 transmits a token issue request to the token issue unit 112 of the access authorization device 101 via the first network 501. This token issuance request includes a refresh token for private API.

(ステップ31)以降は、宅外から宅内に移動した場合とは反対に、宅内向けのアクセストークンを、宅外向けのアクセストークンに切り替える処理を行う。処理の内容は基本的にステップ19〜22と同様の処理を、順次行えばよい。前回発行したパブリックAPI用のアクセストークンは廃棄し、パブリックAPI用のアクセストークンは新たに発行し直す。ただし、前回のパブリックAPI用のアクセストークンをそのまま使用し続けることも可能である。この際、有効期限を延長してもよいし、有効期限は変更しなくてもよい。 After (step 31), contrary to the case of moving from outside the house to the house, a process of switching the access token for home use to the access token for home use is performed. The content of the processing may be basically performed sequentially in the same manner as in steps 19-22. The previously issued public API access token is discarded, and the public API access token is newly issued again. However, it is possible to continue using the access token for the previous public API as it is. At this time, the expiration date may be extended or the expiration date may not be changed.

<通信シーケンスのバリエーション(4)>
通信シーケンスのバリエーション(3)と同様、図5のステップ27の後、ユーザが宅内から宅外に移動して、別途録画予約を行う場合のシーケンスを、以下にステップ32〜37として示す。
<Variation of communication sequence (4)>
Similar to the communication sequence variation (3), after step 27 in FIG. 5, a sequence in which the user moves from the house to the house and makes a separate recording reservation is shown as steps 32 to 37 below.

(ステップ32)ユーザが、宅内から宅外に移動する。この時、通信装置201は、通信をWiFiから、3GないしLTEなどのモバイル広域通信に切り替える。すなわち、通信装置201は、通信の接続先を第2ネットワーク601から第1ネットワーク501に切り換える。 (Step 32) The user moves from inside the house to outside the house. At this time, the communication apparatus 201 switches communication from WiFi to mobile wide area communication such as 3G to LTE. That is, the communication apparatus 201 switches the communication connection destination from the second network 601 to the first network 501.

(ステップ33)クライアントは、ステップ18と同様、リフレッシュトークンを用いて、アクセストークンの発行要求をトークン発行部112に送信する。ステップ3に記すように新規アクセストークンの発行要求でも構わない。いずれにしても、バリエーション(3)がアクセス失敗を契機としてトークン発行要求を行うのに対して、本バリエーションでは、毎回(クライアント起動時に毎回、クライアントのIPアドレス変更時に毎回、リソース利用要求発生時に毎回など)アクセストークン発行要求を行い、プライベートAPIへのアクセス失敗を契機としない。 (Step 33) As in step 18, the client transmits an access token issuance request to the token issuing unit 112 using the refresh token. As described in Step 3, a new access token issue request may be used. In any case, while the variation (3) makes a token issuance request triggered by an access failure, in this variation, every time (every time the client starts, every time the client IP address changes, every time a resource usage request occurs Etc.) An access token issuance request is made and no access failure to the private API is triggered.

(ステップ34)ステップ19と同様、トークン検証部115は、トークン発行要求に含まれるリフレッシュトークンを取得し、取得したリフレッシュトークンが、トークン記憶部117に登録されているかを確認する。これにより、対応するdevice_id(=xyz)を取得する。 (Step 34) Similar to step 19, the token verification unit 115 acquires the refresh token included in the token issuance request, and checks whether the acquired refresh token is registered in the token storage unit 117. As a result, the corresponding device_id (= xyz) is acquired.

(ステップ35)ステップ6と同様、状態判定部114は、宅外アクセスか宅外アクセスかを判定する。ここでは、宅外アクセスであると判定する。 (Step 35) As in step 6, the state determination unit 114 determines whether the access is out-of-home access or out-of-home access. Here, it is determined that the access is outside the home.

(ステップ36)ステップ7と同様、認可対象決定部113は、状態判定部114の判定結果と、ユーザに関連づけられた対象機器301(device_id=xyz)に基づき、対象機器301に搭載されたパブリックAPIを、通信装置201のアクセス認可対象に決定する。 (Step 36) Similar to step 7, the authorization target determining unit 113 uses the public API installed in the target device 301 based on the determination result of the state determination unit 114 and the target device 301 (device_id = xyz) associated with the user. Is determined as an access authorization target of the communication apparatus 201.

(ステップ37)ステップ22と同様、トークン発行部112は、認可対象決定部113の決定に基づき、パブリックAPI用のアクセストークンを発行する。発行されたアクセストークンは、トークン記憶部117に記憶される。また、トークン発行部112は、図2のトークン記憶部117におけるパブリックAPI情報(認可対象情報)を取得し、アクセストークンとパブリックAPI情報等を含むアクセストークン応答を生成する。トークン発行部112は、アクセストークン応答を通信装置201に送信する。なお、リフレッシュトークンの値は、プライベートAPI用のリフレッシュトークンと異なっていてもよい。 (Step 37) Similar to step 22, the token issuing unit 112 issues an access token for public API based on the determination by the authorization target determining unit 113. The issued access token is stored in the token storage unit 117. Further, the token issuing unit 112 acquires the public API information (authorization target information) in the token storage unit 117 in FIG. 2, and generates an access token response including the access token, the public API information, and the like. The token issuing unit 112 transmits an access token response to the communication device 201. The value of the refresh token may be different from the refresh token for private API.

<通信シーケンスのバリエーション(5)>
バリエーション(3)、(4)と同様、図5のステップ27の後、ユーザが宅内から宅外に移動して、別途録画予約を行う場合のシーケンスのバリエーションを示す。バリエーション(3)では、クライアントがプライベートAPIへのアクセスを試行する例を示したが、本バリエーションでは、クライアントがプライベートAPIを有する機器の探索機能を有し、これを毎回(クライアント起動時に毎回、クライアントのIPアドレス変更時に毎回、リソース利用要求発生時に毎回など)実行する。具体的には、マルチキャストDNS、UPnP、ECHONET Lite等の周辺機器の探索機能を用いて、プライベートAPIを備える機器を探索する(プロトコルは、この3つに限定されるものではなく、ホームネットワーク等を対象としたプロトコルにおいて同等機能が定義されている例は多々あり、それらを用いてもよい)。発見対象の機器の機器情報(プライベートAPIを備える機器識別情報(IPアドレス等)あるいはプライベートAPI)は、アクセス認可装置からアクセストークン発行時に関連情報として含まれるケース(図5のprivate_api_path)、対象機器情報を提供するAPIをアクセス認可装置が別途備えているケース、あらかじめクライアントにプリセットされているケース、ユーザがクライアントに手動設定するケースが考えられる。対象機器が見つからなかった場合、クライントは、バリエーション(3)と同様、アクセス認可装置101のトークン発行部112にトークン発行要求を送信する。
<Variation of communication sequence (5)>
As with variations (3) and (4), after step 27 in FIG. 5, a sequence variation in the case where the user moves from the house to the house and makes a separate recording reservation is shown. In variation (3), an example in which a client tries to access a private API has been shown. However, in this variation, the client has a function of searching for a device having a private API, and this is performed each time (every client starts up, the client Every time the IP address is changed, every time a resource use request occurs, etc.). Specifically, a device having a private API is searched using a peripheral device search function such as multicast DNS, UPnP, ECHONET Lite, etc. (The protocol is not limited to these three. There are many examples where equivalent functions are defined in the target protocol, and they may be used). Device information (device identification information (IP address etc.) or private API with a private API) of a device to be discovered is included as related information when an access token is issued from an access authorization device (private_api_path in FIG. 5), target device information There may be a case where the access authorization device is separately provided with an API that provides the password, a case preset in the client, and a case where the user manually sets the client. When the target device is not found, the client transmits a token issuance request to the token issuance unit 112 of the access authorization device 101 as in the variation (3).

<構成のバリエーション(1)>
図7に、本実施形態に係る通信システムの他の構成例を示す。図1のアクセス代行部116と対象機器情報記憶部118が、アクセス認可装置101から除去され、アクセス代行装置(制御代行装置)131として分離して配置されている。アクセス代行装置131は、第1ネットワーク501に接続されており、アクセス認可装置121、通信装置201および対象機器301と通信する通信部119を備えている。
<Configuration variation (1)>
FIG. 7 shows another configuration example of the communication system according to the present embodiment. The access proxy unit 116 and the target device information storage unit 118 of FIG. 1 are removed from the access authorization device 101 and are arranged separately as an access proxy device (control proxy device) 131. The access proxy device 131 is connected to the first network 501 and includes a communication unit 119 that communicates with the access authorization device 121, the communication device 201, and the target device 301.

他の構成例として、トークン記憶部117または対象機器情報記憶部118等の記憶部を全て別個の単独した装置として分離する構成も一般的である。その他、アクセス認可装置で構成する各要素が、様々な組み合わせで別装置として配置され、各機能間の連携が装置間の通信によって実装されてもよい。   As another configuration example, a configuration in which the storage units such as the token storage unit 117 or the target device information storage unit 118 are all separated as separate and independent devices is also common. In addition, each element which comprises an access authorization apparatus may be arrange | positioned as another apparatus with various combinations, and the cooperation between each function may be mounted by communication between apparatuses.

<構成のバリエーション(2)>
図8に、本実施形態に係る通信システムの他の構成例を示す。全体のシステム構成に変化は無いが、認可対象提供部119が追加されている。図5では、トークン発行要求の応答に、プライベートAPI情報(private_api_path)が含まれる例を示しているが、本バリエーションは、このプライベートAPI情報を提供する機能をトークン発行部112から分離した構成をなしている。この構成において、クライアントは、アクセストークン発行後、別途アクセス認可装置上の認可対象提供部119にアクセスする。認可対象提供部119は、アクセストークンの検証後、トークン記憶部117の認可対象情報(API情報)を応答する。
<Configuration variation (2)>
FIG. 8 shows another configuration example of the communication system according to the present embodiment. Although there is no change in the overall system configuration, an authorization object providing unit 119 is added. FIG. 5 shows an example in which the private API information (private_api_path) is included in the response to the token issuance request, but this variation has a configuration in which the function for providing this private API information is separated from the token issuing unit 112. ing. In this configuration, after issuing the access token, the client separately accesses the authorization object providing unit 119 on the access authorization device. The authorization object providing unit 119 returns the authorization object information (API information) in the token storage unit 117 after verifying the access token.

<構成のバリエーション(3)>
図9に、本実施形態に係る通信システムの他の構成例を示す。図1との差分は、通信装置201は、ゲートウェイ装置701を介して1つ以上の対象機器と接続されている点である。ゲートウェイ装置と1つ以上の対象機器とは第3ネットワーク801を介して接続されている(通信可能な状態にある)。以下、各構成要素について説明する。
<Configuration variation (3)>
FIG. 9 shows another configuration example of the communication system according to the present embodiment. The difference from FIG. 1 is that the communication device 201 is connected to one or more target devices via the gateway device 701. The gateway device and one or more target devices are connected via a third network 801 (in a communicable state). Hereinafter, each component will be described.

第3ネットワーク801は、例えばBluetooth、無線LAN、Zigbeeなどローカルネットワークであってもよいし、HDMI(登録商標)やUSBなど有線であって、直接、あるいはハブを介して、ゲートウェイ装置701と対象機器を繋ぐものであってもよい。また、第3ネットワーク801は、第2ネットワーク601と同一のネットワークであってもよい。   The third network 801 may be a local network such as Bluetooth, wireless LAN, or Zigbee, or is wired such as HDMI (registered trademark) or USB, and directly or via a hub, the gateway device 701 and the target device. It may be what connects. Further, the third network 801 may be the same network as the second network 601.

本バリエーションにおける対象機器301、302は、上記実施形態で述べたようにプライベートAPIを備えるものであってもよいが、備えていなくてもよい。本実施形態では備えないものとするが、ゲートウェイ装置701によるリソース利用を受け付ける通信機能は備えているものとする。具体的には、ECHONET Lite対応家電等、何らかのホームネットワーク上で機器を制御するプロトコルに準拠した機器であるものとする。   The target devices 301 and 302 in this variation may be provided with a private API as described in the above embodiment, but may not be provided. Although not provided in this embodiment, it is assumed that a communication function for accepting resource use by the gateway device 701 is provided. Specifically, it is assumed that the device conforms to a protocol for controlling the device on some home network such as an ECHONET Lite-compatible home appliance.

ゲートウェイ装置701は、第2ネットワーク601に接続されるインタフェースと、第3ネットワーク801に接続されるインタフェースを有する。ゲートウェイ装置701は、通信装置201と対象機器301,302との間に介在し、リソース利用要求および応答を中継する装置である。例えばブロードバンドルータのようなルータ装置であったり、PCやスマートフォンといった一般的な計算機の構成をとる装置であったり、スマートメータであったりしてよい。すなわち、ゲートウェイ装置701は、中継装置401と同一であってもよく、さらには、通信装置201と同一であってもよい。ここでは、ブロードバンドルータであるものとする。
ゲートウェイ装置701は、プライベートAPIを備え、第3ネットワーク801を介して接続された対象機器301,302を制御する。すなわち、ゲートウェイ装置701は、アクセス認可装置101のアクセス代行部116と同様のアクセス代行部と、接続された対象機器をアクセス認可装置101に登録する登録部と、を備える。またゲートウェイ装置701は、対象機器情報記憶部118に準ずる機能、すなわち、ゲートウェイ装置701上のアクセス代行部が受信した通信装置201からの要求から、リソース利用の対象機器を特定するための変換情報を備えている。APIのURL中にデバイス識別子を含む場合には、例えばURLから制御対象機器への命令(例えばECHONET Liteリクエスト)に変換する機能をゲートウェイ装置701は備える。
The gateway device 701 has an interface connected to the second network 601 and an interface connected to the third network 801. The gateway device 701 is a device that is interposed between the communication device 201 and the target devices 301 and 302 and relays resource use requests and responses. For example, it may be a router device such as a broadband router, a device having a general computer configuration such as a PC or a smartphone, or a smart meter. That is, the gateway device 701 may be the same as the relay device 401 or may be the same as the communication device 201. Here, it is assumed that it is a broadband router.
The gateway device 701 has a private API and controls the target devices 301 and 302 connected via the third network 801. That is, the gateway device 701 includes an access proxy unit similar to the access proxy unit 116 of the access authorization device 101, and a registration unit that registers the connected target device in the access authorization device 101. Further, the gateway device 701 has a function according to the target device information storage unit 118, that is, conversion information for specifying the target device to use the resource from the request from the communication device 201 received by the access proxy unit on the gateway device 701. I have. When the API identifier includes a device identifier, for example, the gateway device 701 has a function of converting the URL into a command (for example, ECHONET Lite request) to the control target device.

本バリエーションにおいて、APIは、あらたにゲートウェイ装置701がプライベートAPIを備えることを想定したデータ構造になる。一例であるが、パブリックAPIの構成を、以下のようにする実現形態が考えられる。

Figure 2016177795
この場合、一方プライベートAPIは、例えば以下のようになる。
Figure 2016177795
In this variation, the API has a data structure that assumes that the gateway device 701 has a private API. As an example, a configuration in which the configuration of the public API is as follows can be considered.
Figure 2016177795
In this case, the private API is as follows, for example.
Figure 2016177795

これに対応づけて、対象機器情報記憶部118のテーブル構造を2階層してもよい。すなわちゲートウェイ識別子とベースとなるURL(プライベートおよびパブリック用のそれぞれのURL)とを記憶したテーブルと、属するゲートウェイ識別子を含む対象機器情報で構成されるテーブル(この場合、機器識別情報は、アクセス認可装置内で一意に識別できるものでなく、ゲートウェイ装置内で一意に識別できるレベルの識別子であってもよい)と、で構成する方法が考えられる。
または、1階層で構成し、各対象機器情報が、属するゲートウェイ識別情報と、ベースとなるそのURL情報(図2における認可対象情報)を保持するように構成してもよい。
これにより、アクセス認可装置101は、対象機器の特定と同時に適切なゲートウェイ装置のプライベートAPIを特定することができる。本バリエーションにより、クラウドAPIとゲートウェイ装置のプライベートAPIを、シームレスに切り替えることが可能となる。
Correspondingly, the table structure of the target device information storage unit 118 may have two layers. That is, a table storing gateway identifiers and base URLs (private and public URLs), and a table composed of target device information including the gateway identifiers to which the devices belong (in this case, the device identification information is an access authorization device). The identifier may be an identifier of a level that can be uniquely identified within the gateway device).
Alternatively, it may be configured in one layer, and each target device information may be configured to hold the gateway identification information to which it belongs and the URL information (authorization target information in FIG. 2) as a base.
Thereby, the access authorization apparatus 101 can specify the private API of an appropriate gateway apparatus at the same time as specifying the target device. This variation makes it possible to seamlessly switch between the cloud API and the gateway device private API.

(第2の実施形態)
本実施形態は、ユーザが宅外から宅内に移動すると、ユーザのポリシー設定に基づき、パブリックAPI利用からプライベートAPI利用に切り替えるか否かをユーザに問い合わせる等、いくつかの機能を追加したことを特徴とする。以下、本実施形態について詳細に説明する。
(Second Embodiment)
This embodiment is characterized by the addition of several functions such as inquiring the user whether to switch from public API usage to private API usage based on the user's policy settings when the user moves from outside the home. And Hereinafter, this embodiment will be described in detail.

図10は、第2の実施形態に係る通信システムを示す。第1の実施形態に対しアクセス認可装置の構成が異なっている。本実施形態のアクセス認可装置121は、ポリシー記憶部143と、対象機器登録部142と、アクセス制御部141が新たに追加されている。   FIG. 10 shows a communication system according to the second embodiment. The configuration of the access authorization device is different from that of the first embodiment. In the access authorization apparatus 121 of this embodiment, a policy storage unit 143, a target device registration unit 142, and an access control unit 141 are newly added.

ポリシー記憶部143は、API切り替え(あるいはトークン切り替え)に関するポリシー情報を記憶する。ポリシー情報は、一例として、ユーザにAPIの切り替え(あるいはトークンの切り替え)を問い合わせるか否かの設定を含む。別の例として、宅内にいても、常にパブリックAPIを使用することを示す設定を含むポリシーもあり得る。   The policy storage unit 143 stores policy information related to API switching (or token switching). As an example, the policy information includes a setting as to whether or not to inquire the user about API switching (or token switching). As another example, there may be a policy that includes a setting indicating that the public API is always used even in the home.

対象機器登録部142は、対象機器301から登録要求、あるいは、更新要求を受信し、当該要求に従って、対象機器情報記憶部118に情報を記憶または情報を更新する。本実施形態では、対象機器301は、対象機器301のIPアドレスまたはホスト名またはこれらの両方等が変更される際に、更新要求を発行する。対象機器情報記憶部118にはIPアドレスまたはホスト名に基づくプライベートAPIパスが登録されており(図3参照)、IPアドレスまたはホスト名が変更されれば、プライベートAPIパスも更新する。IPアドレスまたはホスト名からプライベートAPIパスを生成する仕組みは事前に定まっているものとする。
または、対象機器301が、変更後のIPアドレスまたはホスト名に基づきプライベートAPIパスを生成し、これを含む更新要求をアクセス認可装置151に送信してもよい。この場合は、更新要求に含まれるプライベートAPIパスを対象機器情報記憶部118に登録すればよい。
登録要求の場合も同様であり、IPアドレスまたはホスト名から対象機器登録部142がプライベートAPIパスを生成してもよいし、対象機器301が、IPアドレスまたはホスト名に基づきプライベートAPIパスを生成し、これを含む登録要求をアクセス認可装置151に送信してもよい。
なお、プライベートAPIパスが変更または登録された場合は、これに応じて図2のトークン記憶部117内のプライベートAPI用の認可対象情報(API情報)も、変更後のプライベートAPIパスに基づいたものに更新するものとする。
対象機器登録部142を、図1、図7、図8または図9のアクセス認可装置に設けてもよい。
The target device registration unit 142 receives a registration request or update request from the target device 301, and stores or updates information in the target device information storage unit 118 according to the request. In the present embodiment, the target device 301 issues an update request when the IP address or host name of the target device 301 or both of them are changed. A private API path based on an IP address or a host name is registered in the target device information storage unit 118 (see FIG. 3), and the private API path is also updated when the IP address or the host name is changed. It is assumed that a mechanism for generating a private API path from an IP address or a host name is determined in advance.
Alternatively, the target device 301 may generate a private API path based on the changed IP address or host name, and transmit an update request including the private API path to the access authorization device 151. In this case, the private API path included in the update request may be registered in the target device information storage unit 118.
The same applies to a registration request. The target device registration unit 142 may generate a private API path from the IP address or host name, or the target device 301 generates a private API path based on the IP address or host name. A registration request including this may be transmitted to the access authorization device 151.
If the private API path is changed or registered, the authorization object information (API information) for the private API in the token storage unit 117 in FIG. 2 is also based on the changed private API path. Shall be updated.
The target device registration unit 142 may be provided in the access authorization device of FIG. 1, FIG. 7, FIG. 8, or FIG.

アクセス制御部141は、トークン発行部112がプライベートAPIへのアクセストークンを発行する場合に、アクセス対象の対象機器301にプライベートAPIの有効化要求を送信する。あるいは、プライベートAPIへのアクセストークンを無効化する場合に、対象機器301にプライベートAPIの無効化要求を送信する。   When the token issuing unit 112 issues an access token for a private API, the access control unit 141 transmits a private API validation request to the access target device 301. Alternatively, when invalidating the access token to the private API, a request for invalidating the private API is transmitted to the target device 301.

対象機器301は、アクセス制御部141から有効化要求を受けると、対象機器301のプライベートAPIをホームネットワーク(第2ネットワーク601)からアクセス可能にする。また、対象機器301は、アクセス制御部141から無効化要求を受けると、対象機器301のプライベートAPIをホームネットワーク(第2ネットワーク601)からアクセスできないようにする。具体的には、対象機器301において、通信装置201に搭載されるクライアントからのアクセスを受け付けるサーバ機能の起動または停止を行う。   Upon receiving an activation request from the access control unit 141, the target device 301 makes the private API of the target device 301 accessible from the home network (second network 601). When the target device 301 receives an invalidation request from the access control unit 141, the target device 301 prevents the target device 301 from accessing the private API from the home network (second network 601). Specifically, the target device 301 starts or stops a server function that accepts access from a client installed in the communication apparatus 201.

あるいは、アクセス制御部141を、単に、有効化または無効化のトリガーを与えるように構成にし、実際に有効化または無効化するかは、対象機器301側で判断するようにしてもよい。またアクセス制御部141は、初回のプライベートAPI発行時には、プライベートAPIを有効化する更新ファームウェアを、対象機器に送信するようにしてもよい。   Alternatively, the access control unit 141 may be simply configured to give an activation or invalidation trigger, and the target device 301 may determine whether to actually activate or deactivate. The access control unit 141 may transmit update firmware that validates the private API to the target device when the private API is issued for the first time.

以下、第2の実施形態に係る通信シーケンスを示す。ここでは第1の実施形態に係る通信シーケンス(図4および図5)との差分のみを説明する。   The communication sequence according to the second embodiment is shown below. Here, only the difference from the communication sequence (FIGS. 4 and 5) according to the first embodiment will be described.

図4のステップ1の前に、対象機器301が、初期登録処理として、IPアドレスなど対象機器情報を、アクセス認可装置151の対象機器登録部142を介して、対象機器情報記憶部118に登録する。このとき、アクセス認可装置151は、対象機器301の認証を行う必要がある。また、ユーザと当該対象機器301を関連づける必要がある。認証および関連づけの双方について、様々な実現方法がある。   Prior to step 1 in FIG. 4, the target device 301 registers target device information such as an IP address in the target device information storage unit 118 via the target device registration unit 142 of the access authorization device 151 as an initial registration process. . At this time, the access authorization device 151 needs to authenticate the target device 301. Further, it is necessary to associate the user with the target device 301. There are various implementations for both authentication and association.

例えば、対象機器301に予め装置認証用の秘密情報を登録しておき、これを、アクセス認可装置151に送信することで、正当な対象機器301のみが対象機器情報をアクセス認可装置151に登録できるようにする。また、ユーザは、対象機器301の秘密情報と共に、所有機器の情報をアクセス認可装置151に登録する。シンプルな実現方法としては、対象機器301の筐体に秘密情報が貼り付けてあり、アクセス認可装置151の登録画面を介して、ユーザがこれを手動登録する等がある。ここで述べた例は一例であり、他にも様々な方法が可能である。   For example, by registering secret information for device authentication in advance in the target device 301 and transmitting it to the access authorization device 151, only the valid target device 301 can register the target device information in the access authorization device 151. Like that. Further, the user registers the information on the owned device together with the secret information of the target device 301 in the access authorization device 151. As a simple realization method, secret information is pasted on the casing of the target device 301, and the user manually registers it via the registration screen of the access authorization device 151. The example described here is an example, and various other methods are possible.

なお、対象機器301は、初期登録処理時だけでなく、IPアドレスの変更など機器情報の変更を検知すると、その都度、アクセス認可装置151に対象機器情報の更新要求を送信する。アクセス認可装置151の対象機器登録部142は、更新要求に基づき、対象機器情報記憶部118内の対象機器301に関する情報を更新する。   Note that the target device 301 transmits a request for updating the target device information to the access authorization device 151 each time it detects a change in device information such as an IP address change as well as during the initial registration process. The target device registration unit 142 of the access authorization device 151 updates information related to the target device 301 in the target device information storage unit 118 based on the update request.

図4のステップ1の認可画面に、ポリシー情報の選択インタフェースを表示し、宅外から宅内へ移動した場合に、API切り替え(トークン切り替え)の確認画面を表示するか否かの設定を含むポリシー情報を、ユーザに選択可能に表示させてもよい。他の種類のポリシー情報も表示し、ユーザが任意のポリシー情報を選択できるようにしてもよい。もちろん、ユーザは、どのポリシー情報を選択しなくてもよく、この場合、第1の実施形態と同様の動作となる。   Policy information including a setting for whether to display an API switching (token switching) confirmation screen when the policy information selection interface is displayed on the authorization screen in Step 1 of FIG. May be displayed to be selectable to the user. Other types of policy information may also be displayed so that the user can select any policy information. Of course, the user does not have to select any policy information, and in this case, the operation is the same as in the first embodiment.

図4のステップ2で、ユーザは、認可画面に表示されたポリシー情報を選択する。   In step 2 of FIG. 4, the user selects the policy information displayed on the authorization screen.

図4のステップ3で、通信装置からアクセス認可装置151に送信するトークン発行要求に、ユーザが選択したポリシー情報を含める。   In step 3 of FIG. 4, the policy information selected by the user is included in the token issue request transmitted from the communication device to the access authorization device 151.

図4のステップ8で、トークン発行時にパブリックAPI用のアクセストークンと関連付けて、ポリシー情報を登録する。上記例では、ポリシー情報の設定をステップ2で行うユーザの認可と関連付けているが、ステップ2のユーザの認可と独立して、ポリシー設定を行えるように構成してもよい。   In step 8 of FIG. 4, policy information is registered in association with an access token for public API when a token is issued. In the above example, the policy information setting is associated with the user authorization performed in step 2, but the policy information may be configured to be independent of the user authorization in step 2.

図5のステップ17とステップ18の間で、ステップ17Aとして、通信装置201はAPI切り替え(トークン切り替え)の確認画面を表示する。例えば、そのままパブリックAPIを使い続けるか、プライベートAPIに切り替えるかを、ユーザに選択させる確認画面を表示する。確認画面の例を図11(A)に示す。ここでは、ユーザがプライベートAPIに切り換える選択をした場合を想定する。   Between step 17 and step 18 in FIG. 5, as step 17A, the communication apparatus 201 displays a confirmation screen for API switching (token switching). For example, a confirmation screen for allowing the user to select whether to continue using the public API or switch to the private API is displayed. An example of the confirmation screen is shown in FIG. Here, it is assumed that the user has selected to switch to the private API.

図5のステップ21とステップ22の間で、ステップ21Aとして、アクセス認可装置151のアクセス制御部141は、対象機器301に、プライベートAPIの有効化要求を送信する。対象機器301は、有効化要求を受けて、プライベートAPIをホームネットワークからアクセス可能にする。具体的には、通信装置201に搭載されるクライアントがアクセスするサーバ機能(HTTPサーバ)を対象機器301が起動する。反対に、プライベートAPIからパブリックAPIに切り替える場合には、アクセス制御部141は対象機器301に無効化要求を行うように構成してもよい。この場合、対象機器301は、サーバ機能の動作を停止させる。なお、プライベートAPIからパブリックAPIに切り替える場合には、図11(B)に示す確認画面を表示して、ユーザに切り換えを許可するか選択させてもよい。   Between step 21 and step 22 in FIG. 5, as step 21 </ b> A, the access control unit 141 of the access authorization device 151 transmits a private API validation request to the target device 301. In response to the activation request, the target device 301 makes the private API accessible from the home network. Specifically, the target device 301 activates a server function (HTTP server) accessed by a client mounted on the communication device 201. Conversely, when switching from the private API to the public API, the access control unit 141 may be configured to make an invalidation request to the target device 301. In this case, the target device 301 stops the operation of the server function. When switching from the private API to the public API, a confirmation screen shown in FIG. 11B may be displayed to allow the user to select whether to allow the switching.

なお、ステップ22において、対象機器301のIPアドレスが変更されている場合には、これに追従した新しいプライベートAPIに対するアクセストークンを発行することができる。   If the IP address of the target device 301 has been changed in step 22, an access token for a new private API that follows this can be issued.

以上、本実施形態によれば、ユーザが、より柔軟なポリシー設定に基づき、パブリックAPIおよびプライベートAPI間の切り替えを制御できる。また、対象機器301のIPアドレスが変化することに起因して、クライアントがプライベートAPIへのアクセスに失敗するケースを回避できる。また、必要時にのみプライベートAPIを有効化することで、ホームネットワーク上でのリソース利用のセキュリティを高めることができる。   As described above, according to the present embodiment, the user can control switching between the public API and the private API based on more flexible policy settings. Further, it is possible to avoid a case where the client fails to access the private API due to the change of the IP address of the target device 301. Also, by enabling the private API only when necessary, it is possible to increase the security of resource use on the home network.

(第3の実施形態)
第1および第2の実施形態では、宅内ネットワークの対象機器にアクセスするプライベートAPIは1つのみであったが、複数のプライベートAPIが存在する場合もある。例えば、ゲートウェイ装置(図9参照)が複数のプライベートAPIを備える場合がある。このとき、アクセス認可装置(サーバ)101は、通信装置201に、どちらのプライベートAPIの使用を許可すれば、通信装置201上のクライアント(アプリ)が、対象機器を操作(アクセス)できるか分からない。このことを、図12を用いて説明する。
(Third embodiment)
In the first and second embodiments, there is only one private API that accesses the target device of the home network, but there may be a plurality of private APIs. For example, the gateway device (see FIG. 9) may include a plurality of private APIs. At this time, the access authorization device (server) 101 does not know which of the private APIs the communication device 201 is allowed to use, so that the client (application) on the communication device 201 can operate (access) the target device. . This will be described with reference to FIG.

図12に本実施形態に係る通信システムの例を示す。ゲートウェイ装置901は、第2ネットワーク601側のインタフェースからアクセス可能なプライベートAPI(プライベートAPI−1と記述する)と、第3ネットワーク801側のインタフェースからアクセス可能なプライベートAPI(プライベートAPI−2と記述する)とを有する。第2の実施形態では通信装置201が、第2ネットワーク601に接続されていたが、図9では、第3ネットワーク801に接続されている。通信装置201が第2ネットワーク601に接続される場合は破線で示している。ゲートウェイ装置901の第2ネットワーク601側のネットワークアドレスと、第3ネットワーク801側のネットワークアドレスとは互いに異なる。例えば第2ネットワーク601側のネットワークアドレスが、192.168.0.0/24であり、第3ネットワーク801側のネットワークアドレスが、192.168.126.0/24である。   FIG. 12 shows an example of a communication system according to this embodiment. The gateway device 901 describes a private API (described as private API-1) accessible from the interface on the second network 601 side and a private API (private API-2) accessible from the interface on the third network 801 side. ). In the second embodiment, the communication apparatus 201 is connected to the second network 601, but in FIG. 9, it is connected to the third network 801. A case where the communication apparatus 201 is connected to the second network 601 is indicated by a broken line. The network address on the second network 601 side of the gateway device 901 is different from the network address on the third network 801 side. For example, the network address on the second network 601 side is 192.168.0.0/24, and the network address on the third network 801 side is 192.168.126.0/24.

通信装置201上のクライアントは、通信装置201が第3ネットワーク801に接続されているときは、プライベートAPI−2にアクセスすれば、ゲートウェイ装置901を介して、対象機器(301または302)を操作可能である。クライアントは、プライベートAPI−1にアクセスした場合は、対象機器を操作できない。一方、通信装置201上のクライアントは、通信装置201が第2ネットワーク601に接続されているときは、プライベートAPI−1にアクセスすれば、ゲートウェイ装置901を介して、対象機器を操作可能である。ただし、クライアントは、プライベートAPI−2にアクセスした場合は、対象機器を操作できない。   When the communication device 201 is connected to the third network 801, the client on the communication device 201 can operate the target device (301 or 302) via the gateway device 901 by accessing the private API-2. It is. The client cannot operate the target device when accessing the private API-1. On the other hand, when the communication device 201 is connected to the second network 601, the client on the communication device 201 can operate the target device via the gateway device 901 by accessing the private API-1. However, the client cannot operate the target device when accessing the private API-2.

アクセス認可装置101が、通信装置201が第2ネットワーク601および第3ネットワーク801のどちらに接続されているかを把握できれば、それに応じて適切なプライベートAPI情報を通信装置201に通知することも可能である。しかしながら、アクセス認可装置101が、通信装置201がどちらのネットワークに接続されているかを把握できない場合もある。例えば中継装置401のNAT機能により、中継装置401の配下の装置からの送信パケットの送信元アドレスは中継装置401のグローバルIPアドレスに統一され、アクセス認可装置101では、通信装置201がどのローカルネットワーク(601、801)に接続されているかを判断できない。   If the access authorization device 101 can grasp whether the communication device 201 is connected to the second network 601 or the third network 801, it is possible to notify the communication device 201 of appropriate private API information accordingly. . However, the access authorization device 101 may not be able to determine which network the communication device 201 is connected to. For example, due to the NAT function of the relay device 401, the transmission source address of the transmission packet from the device under the relay device 401 is unified to the global IP address of the relay device 401. In the access authorization device 101, the local network ( 601 and 801) cannot be determined.

そこで、本実施形態では、アクセス認可装置101が、ゲートウェイ装置の複数のプライベートAPI情報を通信装置201に通知する。通信装置201が複数のプライベートAPI情報のうち、利用可能なプライベートAPI情報を特定し、特定したプライベートAPI情報を用いて、ゲートウェイ装置を介して、対象機器にアクセス(対象機器を操作)する。本実施形態に係る対象機器情報記憶部の構成例を図13に示す。デバイス識別子が“hwg1”のゲートウェイ装置のプライベートAPIパスが2つ登録されている。なお、APIパスの登録形態は、図13(および前述した図3)では、“https://”と“/V1”との間にIPアドレスを配置した形態であるが、IPアドレスのみの形態でもよいし、“/V1”を省いた形態でもよいし、その他の形態でもよい。 Therefore, in this embodiment, the access authorization device 101 notifies the communication device 201 of a plurality of private API information of the gateway device. The communication device 201 specifies available private API information among a plurality of private API information, and accesses the target device (operates the target device) via the gateway device using the specified private API information. A configuration example of the target device information storage unit according to the present embodiment is shown in FIG. Two private API paths of the gateway device having the device identifier “hwg1” are registered. The API path registration form is the form in which the IP address is arranged between “ https: // ” and “/ V1” in FIG. 13 (and FIG. 3 described above). However, a form in which “/ V1” is omitted may be used, or other forms may be used.

以下、本実施形態の動作例を示す。なお、図9を用いて行った説明と重複する説明は、適宜省略する。   Hereinafter, an operation example of this embodiment will be described. In addition, the description which overlaps with the description performed using FIG. 9 is abbreviate | omitted suitably.

まず、初期設定として、通信装置201がアクセストークンの発行を受けるまでの動作例を示す。   First, as an initial setting, an operation example until the communication apparatus 201 receives an access token is shown.

スマートフォン等の通信装置201上で動作するクライアント(アプリケーション)は、対象機器における特定機能(録画予約など)を利用するために、アクセス認可装置101に、トークン発行要求を送信する(図4のステップ3)。   A client (application) operating on the communication device 201 such as a smartphone transmits a token issue request to the access authorization device 101 in order to use a specific function (such as recording reservation) in the target device (step 3 in FIG. 4). ).

トークン発行要求を受けたアクセス認可装置101は、クライアント認証およびユーザ認証を行う(ステップ5およびステップ6)。ユーザ認証とともに、ユーザの認可を求める画面を通信装置201に表示させてもよい。この場合、例えば、トークン発行要求を認証認可URLへ転送(リダイレクト)してもよい。ユーザは、自身の認証情報と、クライアントによる特定機能の利用を認可する旨とを入力する。認証および認可のいずれかが正しく行われなかった場合、トークン発行を行うことができない旨を、アクセス認可装置101はクライアントに通知する。   The access authorization apparatus 101 that has received the token issuance request performs client authentication and user authentication (steps 5 and 6). A screen for requesting user authorization may be displayed on the communication device 201 together with user authentication. In this case, for example, the token issue request may be transferred (redirected) to the authentication authorization URL. The user inputs his / her authentication information and permission to use the specific function by the client. If either authentication or authorization is not performed correctly, the access authorization apparatus 101 notifies the client that a token cannot be issued.

認証および認可が正しく行われた場合、通信装置の状態判定(通信装置201が宅内に存在するか、宅外に存在するか)に応じて、パブリックまたはプライベート用のアクセストークンが、クライアントに対して発行される。または、アクセストークンに加えて、リフレッシュトークンを発行してもよい、両方の役割を兼ねた単一のアクセストークンを発行してもよい。   If authentication and authorization are performed correctly, a public or private access token is sent to the client according to the state determination of the communication device (whether the communication device 201 exists in the house or outside the house). publish. Alternatively, in addition to the access token, a refresh token may be issued, or a single access token serving both roles may be issued.

通信装置201(クライアント)が宅外に存在し、パブリックアクセス用のアクセストークンが発行された場合の、以降のAPIアクセス手順を述べる。   The following API access procedure when the communication apparatus 201 (client) exists outside the home and an access token for public access is issued will be described.

アクセストークンを受け取ったクライアントは、パブリックAPI情報に基づき、アクセス認可装置101に対して、録画予約などのパブリックAPIアクセスを行う(図4のステップ9)。これに先駆けて、クライアントは、宅外に自身が存在することを確認するために、アクセス認可装置などに、クライアントの状態判定(宅内と宅外のどちらに存在するか)を要求してもよい。   The client that has received the access token performs public API access such as recording reservation to the access authorization apparatus 101 based on the public API information (step 9 in FIG. 4). Prior to this, in order to confirm that the client exists outside the home, the client may request an access authorization device or the like to determine the state of the client (whether it exists inside or outside the home). .

パブリックAPIアクセスを受けたアクセス認可装置は、アクセストークンの有効性の検証と、通信装置201(クライアント)の状態判定(宅内と宅外のどちらに存在するか)を行う(ステップ10、ステップ11)。アクセストークンが有効であり、通信装置201が宅外に存在する場合は、アクセス認可装置は、対象機器(録画機器等)に対して、録画予約などの制御を実行する。具体的には、アクセス代行部116が、通信装置201からのパブリックAPIへのアクセスを受けて、アクセス代行部116がリソースの利用要求をゲートウェイ装置901に送信する(ステップ12、ステップ13)。なお、アクセス代行部116がゲートウェイ装置901を利用する方法は事前に定められているものとする。専用のAPIが用意されていてもよいし、プライベートAPIのURLを含むデータをゲートウェイ装置901に送信し、ゲートウェイ装置901が当該データに含まれるプライベットAPIのURLを内部的に解釈および実行してもよい。一方、アクセストークンが有効でない場合、または通信装置201が宅内に存在すると判断した場合、パブリックAPIアクセスを許可できない旨を、クライアントに応答する(図5のステップ16、ステップ17、およびステップ17に続く“認可エラー応答”のシーケンスを参照)。   The access authorization device that has received public API access verifies the validity of the access token and determines the state of the communication device 201 (client) (whether it exists in the house or outside the house) (steps 10 and 11). . When the access token is valid and the communication device 201 exists outside the home, the access authorization device executes control such as recording reservation for the target device (recording device or the like). Specifically, the access proxy unit 116 receives access to the public API from the communication device 201, and the access proxy unit 116 transmits a resource use request to the gateway device 901 (steps 12 and 13). It is assumed that a method for the access proxy unit 116 to use the gateway device 901 is determined in advance. A dedicated API may be prepared, or data including the URL of the private API is transmitted to the gateway device 901. The gateway device 901 internally interprets and executes the URL of the private API included in the data. Also good. On the other hand, if the access token is not valid, or if it is determined that the communication device 201 exists in the home, the client responds that public API access cannot be permitted (continues to step 16, step 17, and step 17 in FIG. 5). (See “Authorization error response” sequence).

なお、アクセストークンの有効性の検証において、アクセストークンが有効でないと判断された場合は、アクセス認可装置は、自装置へのアクセス情報(トークン発行要求の方法など)を、クライアントに通知しても良い。   In the verification of the validity of the access token, if it is determined that the access token is not valid, the access authorization device may notify the client of access information (such as a token issuance request method) to the device itself. good.

通信装置201(クライアント)のユーザが、通信装置201を保持したまま、宅外から宅内に移動したとする。すなわち、通信装置201が宅外に存在する状態から、宅内に存在する状態に変わったとする。この場合に、通信装置201上のクライアントが、パブリックAPI情報に基づき、アクセス認可装置101に対して、録画予約などのパブリックAPIアクセスを行ったとする(図4のステップ9)。アクセス認可装置101は、通信装置201の状態判定において、通信装置201が宅内に存在すると判断して、パブリックAPIアクセスを許可できない旨を、クライアントに応答する(図5のステップ16、ステップ17、およびステップ17に続く“認可エラー応答”のシーケンスを参照)。これにより、クライアントは、通信装置201が宅外から宅内に移動したことを知る。あるいは、前述のように、クライアントが、通信装置201が宅外および宅内のいずれの状態であるかを確認するために、アクセス認可装置などに状態判定を要求してもよい。   It is assumed that the user of the communication apparatus 201 (client) moves from outside the house to the house while holding the communication apparatus 201. That is, it is assumed that the communication device 201 is changed from a state outside the home to a state where the communication device 201 is present inside the home. In this case, it is assumed that the client on the communication apparatus 201 performs public API access such as recording reservation to the access authorization apparatus 101 based on the public API information (step 9 in FIG. 4). In the state determination of the communication device 201, the access authorization device 101 determines that the communication device 201 exists in the home, and responds to the client that public API access cannot be permitted (Step 16, Step 17, and FIG. 5). (See “Authorization error response” sequence following step 17). Thereby, the client knows that the communication apparatus 201 has moved from outside the house to the house. Alternatively, as described above, the client may request status determination from the access authorization device or the like in order to confirm whether the communication device 201 is in the out-of-home state or in-home state.

通信装置201上のクライアントは、トークン発行要求(例えばリフレッシュトークンを含む)をアクセス認可装置101に送信し(図5のステップ18)、アクセス認可装置101は、リフレッシュトークンを検証し、状態判定を行う。ここでは、検証に成功し、通信装置201が宅内に存在すると判断する。そして、アクセス認可装置101は、通信装置201に提供する認可対象情報(API情報)を決定する。ここでは、前述したように、ゲートウェイ装置901のデバイス識別子(device_id)に対して複数のプライベートAPIが存在する。第1の実施形態の図9の例では、プライベートAPIパスが1つ存在したが、本実施形態では複数のプライベートAPIパスが存在する。なお、APIパスごとに、機能(“status”または“reserved_program”)ごとのAPI情報(図2参照)が存在する。   The client on the communication device 201 transmits a token issuance request (for example, including a refresh token) to the access authorization device 101 (step 18 in FIG. 5), and the access authorization device 101 verifies the refresh token and performs state determination. . Here, it is determined that the verification is successful and the communication device 201 exists in the home. Then, the access authorization device 101 determines authorization object information (API information) to be provided to the communication device 201. Here, as described above, a plurality of private APIs exist for the device identifier (device_id) of the gateway device 901. In the example of FIG. 9 of the first embodiment, there is one private API path, but there are a plurality of private API paths in this embodiment. Note that there is API information (see FIG. 2) for each function (“status” or “reserved_program”) for each API path.

アクセス認可装置101は、クライアントから要求された機能(録画等)に対応する複数のAPI情報を含むリストを送信する。複数のAPI情報のリストの代わりに、複数のAPIパスを含むリストを送信してもよい。この場合、APIパスの末尾には端末側で、機能に応じた文字列を付加して、API情報と同じものを生成できるものとする。APIパスは、API情報の一部(例えばAPI情報から機能を特定する部分を除いたもの)に相当する(図2および図3参照)。通信装置201が、ゲートウェイ装置901が備える複数のインタフェースのうちのどれと同じネットワークに接続されているかは、アクセス認可装置では分からない場合があり、複数のAPI情報のうちの1つを特定することはできない。このため、アクセス認可装置101は、ゲートウェイ装置が備えるすべてのプライベートAPIパス(またはクライアントから要求された機能に関するすべてのプライベートAPI情報)のリストを提供する。なお、上述したようなクライアントが状態判定を要求した際に、プライベートAPIパスのリストを、アクセス認可装置101からクライアントに提供してもよい。   The access authorization apparatus 101 transmits a list including a plurality of API information corresponding to functions requested by the client (such as recording). Instead of a list of a plurality of API information, a list including a plurality of API paths may be transmitted. In this case, it is assumed that the terminal can add a character string corresponding to the function to the end of the API path to generate the same API information. The API path corresponds to a part of API information (for example, a part that specifies a function from API information) (see FIGS. 2 and 3). The access authorization device may not know which communication interface 201 is connected to the same network as the plurality of interfaces included in the gateway device 901, and specifies one of the plurality of API information. I can't. For this reason, the access authorization apparatus 101 provides a list of all private API paths (or all private API information related to functions requested by the client) provided in the gateway apparatus. Note that when the client as described above requests a state determination, a list of private API paths may be provided from the access authorization apparatus 101 to the client.

複数のプライベートAPI情報のリスト(または、プライベートAPIパスのリスト)を受け取ったクライアントは、どのプライベートAPI情報を利用するか判定する必要がある。これには複数の方法が考えられる。   A client that has received a list of a plurality of private API information (or a list of private API paths) needs to determine which private API information to use. There are several ways to do this.

(第1の方法)各APIパスを順番に選択して、選択したAPIパスに対して、device_idの返信を要求するメッセージを送信する。選択したAPIパスが、利用できないAPIパスなら、応答は来ない。選択したAPIパスが、期待したAPIパスと異なっているなら、応答されるdevice_idは、自装置がアクセスしたい装置のdevice_id(期待する値)と異なる(例えば複数のサブネットが存在し、サブネットごとに同じIPアドレスのゲートウェイ装置が存在する状況があり得る)。応答されたdevice_idと、期待する値とが一致した場合、選択したAPIパスは正解である。正解のAPIパスが分かった後は、正解のAPIパスを含むプライベートAPI情報に基づき、APIアクセスを実行する(図5のステップ23)。このとき、ゲートウェイ装置901は、アクセス認可装置101に対して、APIアクセスでクライアントから送られるトークンの検証を要求する(図5のステップ24)。この際、アクセス認可装置が備えるtoken introspection endpointを利用してもよい。 (First Method) Each API path is selected in order, and a message requesting a reply of device_id is transmitted to the selected API path. If the selected API path is an unavailable API path, no response is received. If the selected API path is different from the expected API path, the returned device_id is different from the device_id (expected value) of the device that the device wants to access (for example, multiple subnets exist and the same for each subnet) There may be a situation where there is a gateway device of an IP address). If the returned device_id matches the expected value, the selected API path is correct. After the correct API path is known, API access is executed based on the private API information including the correct API path (step 23 in FIG. 5). At this time, the gateway device 901 requests the access authorization device 101 to verify the token sent from the client by API access (step 24 in FIG. 5). At this time, token introspection endpoint provided in the access authorization device may be used.

(第2の方法)クライアントは、API情報のリストとともに、アクセス認可装置101からサーバ証明書(非対称)または事前共有鍵(PSK、対称)またはこれらの両方を受信する。アクセス認可装置は、サーバ証明書または事前共有鍵等も、ゲートウェイ装置のdevice_idに対応づけて、事前に内部に記憶しておく。クライアントは、TLS(Transport Layer Security)またはDTLS(Datagram Transport Layer Security)などの認証機能を使って、正解のAPIパスを判定する。ネットワークで利用できないAPIパスを用いて認証を試みたなら、ゲートウェイ装置901から応答は来ない(IPレイアの通信に失敗する)。また、期待するAPIパスと異なるAPIパスを用いた場合、認証に失敗する。つまり、IPレイヤでの通信は成功するが、TLS等の認証に失敗する。正解のAPIパスが分かった後の動作は、第1の方法と同様である。 (Second Method) The client receives the server certificate (asymmetric) and / or the pre-shared key (PSK, symmetric) or both from the access authorization apparatus 101 together with the list of API information. The access authorization device also stores a server certificate or a pre-shared key in advance in advance in association with the device_id of the gateway device. The client determines the correct API path by using an authentication function such as TLS (Transport Layer Security) or DTLS (Datagram Transport Layer Security). If authentication is attempted using an API path that cannot be used in the network, no response is received from the gateway device 901 (IP layer communication fails). If an API path different from the expected API path is used, authentication fails. That is, communication at the IP layer succeeds, but authentication such as TLS fails. The operation after the correct API path is known is the same as the first method.

第1の方法および第2の方法以外の方法を用いて、使用するAPIパスを決定してもよい。   The API path to be used may be determined using a method other than the first method and the second method.

図14に、アクセス認可装置から複数のAPIパスを取得し、利用するAPIパスを特定する場合の動作のシーケンス例を示す。ゲートウェイ装置は、自装置が有する複数のAPIパスを、アクセス認可装置に通知する(ステップ71)。アクセス認可装置は、通知された複数のAPIパスを登録し、応答を返す(ステップ72)。なお、応答のパケットの送信先のアドレスは、例えばグローバルIPアドレス(例えば“133.196.29.2”)であるが、ルータ401のNAT機能により、送信先のアドレスは、ローカルのIPアドレスに変換されて、パケットがゲートウェイ装置に届く。なお、IPアドレスのみでなく、宛先ポート番号も変換される構成もある。   FIG. 14 shows a sequence example of an operation when acquiring a plurality of API paths from the access authorization device and specifying an API path to be used. The gateway device notifies the access authorization device of a plurality of API paths that the gateway device has (step 71). The access authorization device registers the notified plurality of API paths and returns a response (step 72). Note that the destination address of the response packet is, for example, a global IP address (for example, “133.196.29.2”), but the NAT function of the router 401 changes the destination address to a local IP address. After being converted, the packet reaches the gateway device. There is a configuration in which not only the IP address but also the destination port number is converted.

通信装置上のクライアントが、宅内に存在する状況において、アクセス認可装置に対して、ゲートウェイ装置が備える複数のAPIパスを含むリストを応答するよう、要求したとする(ステップ73)。   Assume that the client on the communication device requests the access authorization device to respond with a list including a plurality of API paths provided in the gateway device in a situation where the client exists in the home (step 73).

アクセス認可装置は、クライアントのユーザに関連づけられて登録されているゲートウェイ装置を特定(または、パケットの送信元アドレスに関連づけられて登録されているゲートウェイ装置を特定)し、特定したゲートウェイ装置が備える複数のAPIパスを特定する。   The access authorization device identifies a gateway device registered in association with the user of the client (or identifies a gateway device registered in association with the transmission source address of the packet), and a plurality of the gateway devices identified Specify the API path of.

ここでは、アクセス認可装置は、2つのゲートウェイ装置(図のhgw1と、hgw2)を特定し、それぞれに対して、2つのAPIパス(WAN側のインタフェースのAPIパスと、LAN側のインタフェースのAPIパス)を特定する。なお、ここでのAPIパスは、プライベートAPIパスである。   Here, the access authorization device identifies two gateway devices (hgw1 and hgw2 in the figure), and for each, two API paths (an API path of the WAN side interface and an API path of the LAN side interface) ). The API path here is a private API path.

アクセス認可装置は、一方のゲートウェイ装置識別子“hgw1”とその2つのAPIパス、ならびに、もう一方のゲートウェイ装置の識別子“hgw2”とその2つのAPIパス、とを含むメッセージを、通信装置上のクライアントに応答する(ステップ74)。   The access authorization device sends a message including one gateway device identifier “hgw1” and its two API paths, and another gateway device identifier “hgw2” and the two API paths to the client on the communication device. (Step 74).

応答のパケットの送信先のアドレスは、例えばグローバルIPアドレス(例えば“133.196.29.2”)あるが、ルータ401のNAT機能により、送信先のアドレスはローカルのIPアドレスに変換されて、パケットが通信装置(クライアント)に届く。なお、IPアドレスのみでなく、宛先ポート番号も変換される構成もある。   The destination address of the response packet is, for example, a global IP address (for example, “133.196.29.2”), but the NAT function of the router 401 converts the destination address into a local IP address. The packet reaches the communication device (client). There is a configuration in which not only the IP address but also the destination port number is converted.

通信装置上のクライアントは、まず一方のゲートウェイ装置(ここではhgw1)を特定し、特定したゲートウェイ装置が備える複数のAPIパスのうちの一方を選択して、device_idの返答を要求するメッセージを送信する(ステップ75)。しかしながら、選択したAPIパスは、当該ゲートウェイ装置のWAN側のネットワークで利用できないため、メッセージに対する応答は送信されない(タイムアウトになる)。通信装置は、もう一方のAPIパスを選択して、device_idの返答を要求するメッセージを送信する(ステップ76)。アクセス認可装置は、当該メッセージに対して、自装置の識別子“hgw1”を含む応答を返す(ステップ77)。この応答に含まれる識別子は、クライアントが期待する識別子と一致するため、当該APIパスに基づくAPI情報を用いて、ゲートウェイ装置にプライベートAPIアクセスすることにより、ゲートウェイ装置の配下の対象機器を制御する(ステップ78)。   The client on the communication device first identifies one gateway device (here, hgw1), selects one of a plurality of API paths provided in the identified gateway device, and transmits a message requesting a response of device_id. (Step 75). However, since the selected API path cannot be used in the WAN side network of the gateway device, a response to the message is not transmitted (timeout occurs). The communication device selects the other API path and transmits a message requesting a response of device_id (step 76). In response to the message, the access authorization device returns a response including its own identifier “hgw1” (step 77). Since the identifier included in the response matches the identifier expected by the client, the target device under control of the gateway device is controlled by performing private API access to the gateway device using API information based on the API path ( Step 78).

図15に、アクセス認可装置から複数のAPIパスを取得し、利用するAPIパスを1つに特定する場合の動作の他のシーケンス例を示す。最初のステップ71、72は図14と同様である。   FIG. 15 shows another sequence example of the operation when acquiring a plurality of API paths from the access authorization device and specifying one API path to be used. The first steps 71 and 72 are the same as in FIG.

ステップ72に続くステップ81では、通信装置上のクライアントが、自装置の状態判定(宅内および宅外のいずれに存在するか)の問い合わせのメッセージを送信する。アクセス認可装置は、状態判定を行うことにより、通信装置が宅内に存在すると判断する。また、アクセス認可装置は、宅内に存在しうるゲートウェイ装置として、ここではhgw1の1つを特定する(ここでは、たまたまユーザまたは送信元IPアドレスに対して、1つのゲートウェイ装置のみがアクセス認可装置に登録されていたとする)。アクセス認可装置は、ゲートウェイ装置の識別子“hgw1”と、その2つのAPIパスとを含むメッセージを、通信装置上のクライアントに応答する(ステップ82)。この後のステップ75〜78は、図14と同じである。   In step 81 following step 72, the client on the communication device transmits a message for inquiring about the state of the device (whether it exists in the house or outside the house). The access authorization device determines that the communication device exists in the home by performing the state determination. In addition, the access authorization device specifies one of hgw1 as a gateway device that can exist in the house (here, only one gateway device happens to be the access authorization device for the user or the source IP address). Suppose it was registered). The access authorization device responds to the client on the communication device with a message including the identifier “hgw1” of the gateway device and the two API paths (step 82). The subsequent steps 75 to 78 are the same as those in FIG.

図16は、図15のシーケンスにおいて通信装置が宅外にいると判定された場合の動作の例を示す。ステップ71、72、81までは図15と同じである。   FIG. 16 shows an example of the operation when it is determined in the sequence of FIG. 15 that the communication device is outside the home. Steps 71, 72, and 81 are the same as those in FIG.

ステップ81の次のステップ85として、アクセス認可装置は、通信装置が宅外に存在することを通知するメッセージを送信する。通信装置上のクライアントは、パブリックAPI情報に基づき、アクセス認可装置に対してパブリックAPIアクセスを行う(ステップ86、87)。なお、パブリックアクセス用のアクセストークンの発行をまだ受けていない場合、トークン発行要求を先に行う。   As step 85 following step 81, the access authorization device transmits a message notifying that the communication device exists outside the home. The client on the communication device performs public API access to the access authorization device based on the public API information (steps 86 and 87). If an access token for public access has not been issued yet, a token issuance request is made first.

前述した図14のシーケンスでは、通信装置が仮に宅外にいる状態で、各APIパスに対する検査(ステップ75およびステップ76)を行った場合、各APIパスともタイムアウトになるまで、クライアントは、通信装置が宅外にいることが分からない。タイムアウトになった時点で、クライアントは、宅外アクセスに切り換えることができる。一方、図15および図16のシーケンスでは、クライアントがアクセス認可装置に状態判定を要求するため、宅内および宅外のいずれにいるかが事前に分かった上で、クライアントは動作することができる。したがって、図15および図16のシーケンスでは、宅外にいる場合の動作の遅延を防止できる利点がある。   In the above-described sequence of FIG. 14, when an inspection is performed on each API path (step 75 and step 76) while the communication device is outside the home, the client is connected to the communication device until each API path times out. I don't know that is outside the house. When the timeout expires, the client can switch to outside access. On the other hand, in the sequences of FIGS. 15 and 16, since the client requests the access authorization device to determine the state, the client can operate after knowing in advance whether it is in the house or outside the house. Therefore, the sequences of FIGS. 15 and 16 have an advantage that it is possible to prevent a delay in operation when the user is away from home.

(第4の実施形態)
第1ネットワーク501がCGN(Carrier Grade NAT)またはLSN(Large Scale NAT)(以下、CGN/LSNと記載)の機能を備える場合を想定する。この場合、アクセス認可装置による状態判定によって、通信装置が宅内に存在すると判断されたにも関わらず、クライアントが、アクセス認可装置から通知された全てのプライベートAPIパスのいずれにもアクセスできない状況が発生する場合がある。
(Fourth embodiment)
It is assumed that the first network 501 has a function of CGN (Carrier Grade NAT) or LSN (Large Scale NAT) (hereinafter referred to as CGN / LSN). In this case, there is a situation where the client cannot access any of all the private API paths notified from the access authorization device, even though it is determined by the access authorization device that the communication device exists in the house. There is a case.

図17に、本実施形態に係る通信システムの構成例を示す。図17の通信システムは、図10の構成をベースにしている。第1ネットワーク501は、CGN/LSNの機能を備えている。中継装置1101および第3ネットワーク1102は、中継装置401、第2ネットワークおよび対象機器301とは別の家屋内に配置されている。通信装置1103は、スマートフォン等の通信装置である。第3ネットワーク1102は、例えばホームネットワーク(ローカルネットワーク)である。ただし、第2ネットワーク601の場合と同様、他の種類のネットワークでもよい。中継装置1101は、NAT機能を備えたブロードバンドルータである。図では通信装置1103が第3ネットワーク1102に接続されている。通信装置1103は、中継装置101を介して第1ネットワーク501に接続されている。ただし、通信装置1103は、第1ネットワーク501に直接接続することも可能である。   FIG. 17 shows a configuration example of a communication system according to the present embodiment. The communication system of FIG. 17 is based on the configuration of FIG. The first network 501 has a CGN / LSN function. The relay device 1101 and the third network 1102 are arranged in a different house from the relay device 401, the second network, and the target device 301. The communication device 1103 is a communication device such as a smartphone. The third network 1102 is, for example, a home network (local network). However, as in the case of the second network 601, another type of network may be used. The relay device 1101 is a broadband router having a NAT function. In the figure, the communication device 1103 is connected to the third network 1102. The communication device 1103 is connected to the first network 501 via the relay device 101. However, the communication device 1103 can be directly connected to the first network 501.

通信装置1103が第3ネットワーク1102に接続されているときに、第2ネットワーク601に接続された対象機器301を制御する場合を考える。通信装置1103上のクライアントが、中継装置1101を介してアクセス認可装置151に、プライベートAPIアクセス用のトークン発行要求(図5のステップ18)を送信する。アクセス認可装置が、トークン検証および状態判定を行い、通信装置1103が宅内に存在すると判断する。   Consider a case in which the target device 301 connected to the second network 601 is controlled when the communication device 1103 is connected to the third network 1102. The client on the communication device 1103 transmits a token issuance request for private API access (step 18 in FIG. 5) to the access authorization device 151 via the relay device 1101. The access authorization device performs token verification and state determination, and determines that the communication device 1103 exists in the home.

第1ネットワーク501がCGN/LSNの機能を備える場合、中継装置1101および中継装置401のいずれのWAN側インタフェース(第1ネットワーク501側のインタフェース)にも、それぞれローカルIPアドレスが割り当てられる場合がある。この場合、中継装置401の宅内から送信されるパケットの送信元IPアドレスも、中継装置1101の家屋内から送信されるパケットの送信元IPアドレスも、CGN/LSNにより、同一のグローバルIPアドレスに変換されて、アクセス認可装置151に送信される。したがって、アクセス認可装置151では、IPアドレスを元に状態判定を行う場合、通信装置1103が第3ネットワーク1102および第2ネットワーク601のどちらに接続されているかを区別できない。このためアクセス認可装置は、通信装置1103が、中継装置401の宅内に存在すると判断し、対象機器301のプライベートAPIパス(またはプライベートAPI情報)を含む応答を、通信装置1103に送信する。なお、ここでは第3ネットワーク1102にはAPIアクセス可能な対象機器が存在しない場合を想定する。   When the first network 501 has a CGN / LSN function, a local IP address may be assigned to any of the WAN side interfaces (interfaces on the first network 501 side) of the relay device 1101 and the relay device 401, respectively. In this case, both the source IP address of the packet transmitted from the home of the relay device 401 and the source IP address of the packet transmitted from the home of the relay device 1101 are converted into the same global IP address by the CGN / LSN. And transmitted to the access authorization device 151. Therefore, the access authorization device 151 cannot distinguish whether the communication device 1103 is connected to the third network 1102 or the second network 601 when performing the state determination based on the IP address. For this reason, the access authorization device determines that the communication device 1103 exists in the home of the relay device 401, and transmits a response including the private API path (or private API information) of the target device 301 to the communication device 1103. Here, it is assumed that there is no target device that can be accessed by the API in the third network 1102.

通信装置1103上のクライアントは、通知されたプライベートAPI情報を用いて対象機器301にアクセスしようとしても、対象機器301と同じ家屋(ローカルネットワーク)に存在しないため、対象機器301にアクセスできない。例えば、第1ネットワーク501内のルータからパケットを転送できない旨のエラーメッセージが返ってきたり、タイムアウトになったり、対象機器301のプライベートAPIパスがドメイン名などを用いて表現されている場合にIPアドレスをDNSから取得できない、などのエラーが発生し得る。この問題を解決するため、以下の複数の方法が考えられる。本実施形態では、これらのいずれかの方法を実行する。   Even if the client on the communication device 1103 tries to access the target device 301 using the notified private API information, the client cannot access the target device 301 because it does not exist in the same house (local network) as the target device 301. For example, when an error message indicating that a packet cannot be transferred from the router in the first network 501 is returned, a timeout occurs, or the private API path of the target device 301 is expressed using a domain name or the like, the IP address May not be able to be retrieved from DNS. In order to solve this problem, the following methods are conceivable. In the present embodiment, any one of these methods is executed.

(第1の方法)通信装置1103上のクライアントは、エラー発生後、一定時間をおいて、アクセス認可装置に、状態判定の要求、またはトークン発行要求(図5のステップ18)を行う。CGN/LSN機能を備えたネットワークでは、NATの適用箇所が時間経過によって変わる場合がある。この場合、中継装置1101(ローカルIPアドレスしかもっていない)からのパケットはグローバルIPアドレス #1 からのパケットに変換され、中継装置401からのパケットはグローバルIP アドレス#2からのパケットに変換されることもある(ある時刻は両方ともグローバルIPアドレスは#1だった)。。これによりアクセス認可装置の対象機器情報記憶部118等が更新され、状態判定の結果も変わり得る。例えば、通信装置1103が、中継装置401の宅外に存在すると判断される。これにより通信装置1103は、アクセス認可装置により宅外に存在すると判断され、パブリックAPIパス(またはパブリックAPI情報)が通信装置1103に送られる。通信装置1103は、パブリックAPI情報に基づき、アクセス認可装置151を介して対象機器301を操作する。   (First Method) The client on the communication device 1103 makes a request for status determination or a token issuance request (step 18 in FIG. 5) to the access authorization device after a certain period of time after an error occurs. In a network having a CGN / LSN function, the location where NAT is applied may change over time. In this case, a packet from the relay device 1101 (which has only a local IP address) is converted into a packet from the global IP address # 1, and a packet from the relay device 401 is converted into a packet from the global IP address # 2. (At some time both global IP addresses were # 1). . As a result, the target device information storage unit 118 and the like of the access authorization device are updated, and the result of the state determination can be changed. For example, it is determined that the communication device 1103 exists outside the relay device 401. As a result, the communication device 1103 is determined to exist outside the home by the access authorization device, and a public API path (or public API information) is sent to the communication device 1103. The communication device 1103 operates the target device 301 via the access authorization device 151 based on public API information.

(第2の方法)通信装置1103は、アクセス認可装置151から通知されたプライベートAPI情報で、対象機器301にアクセスできない旨を伝えるフラグを立てたメッセージを、アクセス認可装置151に送信する。このフラグが立てられたメッセージを受信した場合、アクセス認可装置は、状態判定を省略する。この際、状態判定を省略したことのログをとってもよい。状態判定を省略した場合、アクセス認可装置151は、通信装置1103に対して、対象機器301に対するパブリックAPI情報を通知またはパブリックアクセス用のアクセストークンを発行するようにすればよい。   (Second Method) The communication device 1103 transmits to the access authorization device 151 a message with a flag indicating that the target device 301 cannot be accessed with the private API information notified from the access authorization device 151. When the message with this flag set is received, the access authorization device omits the state determination. At this time, a log indicating that the state determination is omitted may be taken. When the state determination is omitted, the access authorization device 151 may notify the communication device 1103 of public API information for the target device 301 or issue an access token for public access.

(第3の方法)通信装置1103は、プライベートAPI情報でのアクセスに失敗したときのエラー内容(応答パケットなど)を含むメッセージを、アクセス認可装置151に送信する。アクセス認可装置は、当該メッセージに含まれるエラー内容を、メモリ装置等の記憶装置に記録する。過去に報告されたエラー内容や、その他の情報と照合して、そのエラー内容が尤もらしいかどうかを判定する(公知の尤度判定を行えばよい)。尤度が一定値以上であれば、状態判定を省略し、上記と同様の処理を行えばよい。   (Third Method) The communication device 1103 transmits a message including an error content (response packet or the like) when access with private API information has failed to the access authorization device 151. The access authorization device records the error content included in the message in a storage device such as a memory device. The error contents reported in the past and other information are collated to determine whether the error contents are plausible (a known likelihood determination may be performed). If the likelihood is equal to or greater than a certain value, the state determination may be omitted and the same processing as described above may be performed.

尚、各実施形態のアクセス認可装置、通信装置および対象機器の各装置は、例えば、汎用のコンピュータ装置を基本ハードウェアとして用いることでも実現可能である。すなわち、上記のコンピュータ装置に搭載されたプロセッサにプログラムを実行させることにより実現出来る。このとき、各装置は、上記のプログラムをコンピュータ装置にあらかじめインストールすることで実現することや、各種の記憶媒体に記憶、あるいはネットワークを介して上記のプログラムを配布、このプログラムをコンピュータ装置に適宜インストールすることで実現が出来る。また、各装置内の各記憶部は、上記のコンピュータ装置に内蔵あるいは外付けされたメモリ、ハードディスクもしくはCD−R、CD−RW、DVD−RAM、DVD−Rなどの記憶媒体などを適宜利用して実現することができる。   In addition, each apparatus of the access authorization apparatus of each embodiment, a communication apparatus, and object apparatus is realizable also by using a general purpose computer apparatus as basic hardware, for example. That is, it can be realized by causing a processor mounted on the computer apparatus to execute a program. At this time, each device can be realized by installing the above program in the computer device in advance, or can be stored in various storage media or distributed through the network, and the program can be installed in the computer device as appropriate. This can be realized. Each storage unit in each apparatus appropriately uses a memory, a hard disk or a storage medium such as a CD-R, a CD-RW, a DVD-RAM, a DVD-R, or the like incorporated in or externally attached to the computer apparatus. Can be realized.

本発明は上記実施形態そのままに限定されず、実施段階では要旨を逸脱しない範囲で構成要素を変形し具体化出来る。上記実施形態に開示されている複数の構成要素の適宜な組み合わせで、種々の発明を形成できる。例えば、実施形態に示される全構成要素から幾つかの構成要素を削除出来、異なる実施形態に渡る要素を適宜組み合わせることも出来る。   The present invention is not limited to the above-described embodiments as they are, and the constituent elements can be modified and embodied without departing from the spirit in the implementation stage. Various inventions can be formed by appropriately combining a plurality of constituent elements disclosed in the embodiment. For example, some constituent elements can be deleted from all the constituent elements shown in the embodiments, and elements over different embodiments can be appropriately combined.

101:アクセス認可装置
201:通信装置
301:対象機器
302:対象機器
401:中継装置
501:第1ネットワーク
601:第2ネットワーク
701:ゲートウェイ装置
801:第3ネットワーク
111:通信部
112:トークン発行部
113:認可対象決定部
114:状態判定部
115:トークン検証部
116:アクセス代行部
117:トークン記憶部
118:対象機器情報記憶部
119:認可対象提供部
141:アクセス制御部
142:対象機器登録部
143:ポリシー記憶部
101: Access authorization device 201: Communication device 301: Target device 302: Target device 401: Relay device 501: First network 601: Second network 701: Gateway device 801: Third network
111: Communication unit 112: Token issuance unit 113: Authorization target determination unit 114: State determination unit 115: Token verification unit 116: Access proxy unit 117: Token storage unit 118: Target device information storage unit 119: Authorization target provision unit 141: Access control unit 142: target device registration unit 143: policy storage unit

Claims (24)

ネットワークに接続された対象機器と、および前記対象機器が提供するリソースを利用可能な通信装置と通信する通信部と、
前記通信装置と前記ネットワークとの接続状態を特定するための情報を前記通信装置および前記対象機器の少なくとも一方から取得し、前記情報に基づき前記接続状態を判定する状態判定部と、
前記対象機器が提供するリソースの利用要求を前記対象機器に送信するアクセス代行部と、
前記接続状態に基づき、前記対象機器が提供するリソースの利用要求を前記通信装置が前記対象機器に送信するか、前記アクセス代行部が前記対象機器に送信するかを決定する決定部と、
を備えるアクセス認可装置。
A communication unit that communicates with a target device connected to a network, and a communication device that can use resources provided by the target device;
A state determination unit that acquires information for specifying a connection state between the communication device and the network from at least one of the communication device and the target device, and determines the connection state based on the information;
An access proxy unit that transmits a request to use the resource provided by the target device to the target device;
A determination unit that determines whether the communication device transmits a request to use the resource provided by the target device to the target device based on the connection state, or whether the access proxy unit transmits to the target device;
An access authorization device comprising:
前記状態判定部は、前記通信装置が前記ネットワークに接続されているか否か、または前記ネットワークに接続可能な状態か否かを判定する
請求項1に記載のアクセス認可装置。
The access authorization device according to claim 1, wherein the state determination unit determines whether the communication device is connected to the network or is connectable to the network.
前記決定部は、前記通信装置が前記ネットワークに接続されているまたは接続可能な状態の場合、前記通信装置から前記対象機器に前記利用要求を送信することを決定して、前記対象機器へ前記利用要求を送信することの指示情報を、前記通信装置に送信する
請求項2に記載のアクセス認可装置。
When the communication device is connected to the network or in a connectable state, the determination unit determines to transmit the use request from the communication device to the target device, and the use to the target device The access authorization apparatus according to claim 2, wherein instruction information for transmitting a request is transmitted to the communication apparatus.
前記決定部は、前記指示情報を前記通信装置に送信した後、前記通信装置から前記対象機器への前記利用要求の送信に対してエラーが発生した旨の報告を受けた場合は、前記アクセス代行部が前記利用要求を前記対象機器に送信することを決定し、
前記アクセス代行部は、前記決定部の決定に応じて、前記利用要求を前記対象機器へ送信する
請求項3に記載のアクセス認可装置。
The determining unit, after transmitting the instruction information to the communication device, receives a report that an error has occurred with respect to the transmission of the use request from the communication device to the target device. Determined to transmit the usage request to the target device,
The access authorization device according to claim 3, wherein the access proxy unit transmits the use request to the target device according to the determination of the determination unit.
前記決定部は、前記通信装置が前記ネットワークに接続されていない場合または接続不能な状態の場合、前記アクセス代行部が前記対象機器に前記利用要求を送信することを決定し、
前記アクセス代行部は、前記決定部の決定に応じて、前記利用要求を前記対象機器へ送信する
請求項2または3に記載のアクセス認可装置。
The determining unit determines that the access proxy unit transmits the use request to the target device when the communication device is not connected to the network or is not connectable.
The access authorization device according to claim 2 or 3, wherein the access proxy unit transmits the use request to the target device according to the determination of the determination unit.
前記通信部は、前記通信装置から送信される第1要求を受信し、
前記状態判定部は、前記第1要求が受信された場合に、前記接続状態の判定を行う
請求項1ないし5のいずれか一項に記載のアクセス認可装置。
The communication unit receives a first request transmitted from the communication device,
The access authorization device according to any one of claims 1 to 5, wherein the state determination unit determines the connection state when the first request is received.
前記第1要求は、前記リソースの利用に関する許可要求、または前記リソースの利用要求の少なくとも一方である
請求項6に記載のアクセス認可装置。
The access authorization apparatus according to claim 6, wherein the first request is at least one of a permission request regarding use of the resource and a use request of the resource.
前記許可要求に基づく前記接続状態の判定に応じて、前記通信装置が前記ネットワークに接続されていないまたは接続不能な状態と判定した場合に、前記リソースの利用要求を前記アクセス代行部が受け付けるための第1API(Application Programming Interface)に関する情報を含む第1許可応答を前記通信装置に送信し、
前記アクセス代行部は、前記通信装置からの前記第1APIに関する情報に基づく前記リソースの利用要求を受けて、前記リソースの利用要求を前記対象機器に送信する
請求項7に記載のアクセス認可装置。
In response to the determination of the connection state based on the permission request, when the communication device determines that the communication device is not connected to the network or cannot be connected, the access proxy unit accepts the resource use request. A first authorization response including information related to a first API (Application Programming Interface) is transmitted to the communication device;
The access authorization device according to claim 7, wherein the access proxy unit receives the resource usage request based on the information related to the first API from the communication device, and transmits the resource usage request to the target device.
前記通信装置からの前記リソースの利用要求に基づく前記接続状態の判定に応じて、前記通信装置が前記ネットワークに接続されているまたは接続可能な状態であると判定した場合に、エラー応答を前記通信装置に送信し、
前記エラー応答を送信後、前記通信装置から前記リソースの利用に関する前記許可要求を受信し、前記許可要求に基づく前記接続状態の判定に応じて、前記通信装置が前記ネットワークに接続されている場合または接続可能な状態であると判定した場合に、前記利用要求を送信することの指示情報を含む第2許可応答を前記通信装置に送信する
請求項7に記載のアクセス認可装置。
In response to the determination of the connection state based on the resource usage request from the communication device, if it is determined that the communication device is connected to the network or is in a connectable state, an error response is transmitted to the communication device. To the device,
After transmitting the error response, receiving the permission request regarding the use of the resource from the communication device, and depending on the determination of the connection state based on the permission request, the communication device is connected to the network or The access authorization device according to claim 7, wherein when it is determined that the connection is possible, a second permission response including instruction information for transmitting the use request is transmitted to the communication device.
前記第2許可応答は、前記対象機器が前記リソースの利用要求を受け付けるための第2API(Application Programming Interface)に関する情報を含む
請求項9に記載のアクセス認可装置。
The access authorization apparatus according to claim 9, wherein the second permission response includes information related to a second API (Application Programming Interface) for the target device to accept a request to use the resource.
前記第2APIは、ゲートウェイ装置が前記対象機器への前記リソースの利用要求を受け付けるためのAPIであり、
前記通信部は、前記対象機器の代わりに、前記ゲートウェイ装置と通信する
請求項10に記載のアクセス認可装置。
The second API is an API for the gateway device to accept a request to use the resource to the target device.
The access authorization device according to claim 10, wherein the communication unit communicates with the gateway device instead of the target device.
前記第2許可応答は、複数の前記第2APIに関する情報を含み、
前記ゲートウェイ装置は複数のネットワークに接続されており、前記ネットワークごとに、受け付け可能な前記第2APIが異なる
請求項11に記載のアクセス認可装置。
The second permission response includes information on a plurality of the second APIs,
The access authorization device according to claim 11, wherein the gateway device is connected to a plurality of networks, and the second API that can be accepted is different for each network.
前記通信装置からの前記リソースの利用要求に基づく前記接続状態の判定に応じて、前記通信装置が前記ネットワークに接続されているまたは接続可能な状態であると判定した場合に、複数の第2APIに関する情報を含む応答を、前記通信装置に送信し、
前記第2APIは、ゲートウェイ装置が前記対象機器への前記リソースの利用要求を受け付けるためのAPIであり、
前記通信部は、前記対象機器の代わりに、前記ゲートウェイ装置と通信し、
前記ゲートウェイ装置は複数のネットワークに接続されており、前記ネットワークごとに、受け付け可能な前記第2APIが異なる
請求項7に記載のアクセス認可装置。
In response to the determination of the connection state based on the resource usage request from the communication device, when it is determined that the communication device is connected to or connectable to the network, a plurality of second APIs Sending a response including information to the communication device;
The second API is an API for the gateway device to accept a request to use the resource to the target device.
The communication unit communicates with the gateway device instead of the target device,
The access authorization device according to claim 7, wherein the gateway device is connected to a plurality of networks, and the second API that can be accepted is different for each network.
前記状態判定部は、前記通信装置から受信する前記第1要求の送信元IPアドレスが、前記対象機器に対して予め登録したIPアドレスに一致するか、または予め登録したIPアドレスの範囲に含まれるかに応じて、前記通信装置が前記ネットワークに接続されているかを判定する
請求項6ないし13のいずれか一項に記載のアクセス認可装置。
In the state determination unit, the transmission source IP address of the first request received from the communication device matches an IP address registered in advance with respect to the target device, or is included in a range of IP addresses registered in advance. The access authorization device according to any one of claims 6 to 13, wherein the communication device determines whether the communication device is connected to the network.
前記状態判定部は、前記通信装置が存在する位置を特定する情報を前記通信装置から受信し、受信した情報と、前記対象機器の予め取得した位置情報とに基づいて、前記通信装置が前記ネットワークに接続可能な状態かを判定する
請求項6ないし13のいずれか一項に記載のアクセス認可装置。
The state determination unit receives information specifying a position where the communication device exists from the communication device, and based on the received information and location information acquired in advance of the target device, the communication device The access authorization device according to any one of claims 6 to 13, wherein it is determined whether or not the connection is possible.
前記状態判定部が、前記通信装置が前記ネットワークに接続されているまたは接続可能であると判定した場合に、前記リソースの利用要求を受け付ける機能を有効化することの指示情報を前記対象機器に送信する
請求項1ないし15のいずれか一項に記載のアクセス認可装置。
When the state determination unit determines that the communication device is connected to or can be connected to the network, the state determination unit transmits instruction information for activating the function of accepting the resource use request to the target device. The access authorization device according to any one of claims 1 to 15.
前記状態判定部が、前記通信装置が前記ネットワークに接続されていない場合または接続不能な状態の場合と判定した場合に、前記リソースの利用要求を受け付ける機能を無効化することの指示情報を前記対象機器に送信する
請求項1ないし16のいずれか一項に記載のアクセス認可装置。
When the state determination unit determines that the communication device is not connected to the network or is in a state where connection is not possible, instruction information for disabling the function of accepting the resource use request is included in the target The access authorization device according to any one of claims 1 to 16, wherein the access authorization device is transmitted to a device.
前記通信装置が前記ネットワークに接続されていないまたは接続不能な状態であるとの判定から、前記通信装置が前記ネットワークに接続されているまたは接続可能な状態であるとの判定に変更された場合、予め与えられたポリシー情報に基づき、前記通信装置のユーザに、変更の許諾を得る必要があるか否かを判断し、許諾を得る必要がある場合には、ユーザの許諾を示す情報を受信した後で、前記対象機器に前記リソースの利用要求を送信することの指示情報を前記通信装置に送信する
請求項1ないし17のいずれか一項に記載のアクセス認可装置。
When the determination that the communication device is not connected to the network or in a state where the communication device is not connected is changed to the determination that the communication device is connected to or connected to the network, Based on the policy information given in advance, it is determined whether or not it is necessary to obtain a change permission from the user of the communication device, and if it is necessary to obtain a permission, information indicating the permission of the user is received. The access authorization device according to any one of claims 1 to 17, wherein later, instruction information for transmitting the resource use request to the target device is transmitted to the communication device.
予め与えられたポリシー情報が前記通信装置が前記ネットワークに接続されているまたは接続可能な場合も、前記アクセス代行部がリソースの利用要求の送信を代行することを示す場合は、前記通信装置が前記ネットワークに接続されているまたは接続可能な場合も、前記アクセス代行部は前記リソースの利用要求を前記対象機器に送信する
請求項1ないし13のいずれか一項に記載のアクセス認可装置。
In the case where the policy information given in advance indicates that the access proxy unit performs transmission of a resource use request when the communication device is connected to or connectable to the network, the communication device The access authorization device according to any one of claims 1 to 13, wherein the access proxy unit transmits a request to use the resource to the target device even when connected to a network or connectable.
前記通信部は、前記通信装置が前記ネットワークに接続されているまたは接続可能な状態であると判定された場合、前記対象機器との通信コネクションを切断する
請求項1ないし19のいずれか一項に記載のアクセス認可装置。
The communication unit disconnects a communication connection with the target device when it is determined that the communication device is connected to or connected to the network. The access authorization device described.
ネットワークに接続された対象機器が提供するリソースを利用可能な通信装置と前記ネットワークとの接続状態を特定するための情報を前記通信装置および前記対象機器の少なくとも一方から取得し、前記情報に基づき前記接続状態を判定する状態判定ステップと、 前記接続状態に基づき、前記対象機器が提供するリソースの利用要求を前記通信装置が前記対象機器に送信するか、アクセス代行部が送信するかを決定する決定ステップと、
を備えたアクセス認可方法。
Information for identifying a connection state between a communication device that can use a resource provided by a target device connected to a network and the network is acquired from at least one of the communication device and the target device, and based on the information, A state determination step for determining a connection state; and a determination for determining whether the communication device transmits a request for using a resource provided by the target device to the target device or an access proxy unit based on the connection state Steps,
An access authorization method comprising:
ネットワークに接続された対象機器が提供するリソースを利用可能な通信装置と前記ネットワークとの接続状態を特定するための情報を前記通信装置および前記対象機器の少なくとも一方から取得し、前記情報に基づき前記接続状態を判定する状態判定ステップと、 前記接続状態に基づき、前記対象機器が提供するリソースの利用要求を前記通信装置が前記対象機器に送信するか、アクセス代行部が送信するかを決定する決定ステップと、
をコンピュータに実行させるためのプログラム。
Information for identifying a connection state between a communication device that can use a resource provided by a target device connected to a network and the network is acquired from at least one of the communication device and the target device, and based on the information, A state determination step for determining a connection state; and a determination for determining whether the communication device transmits a request for using a resource provided by the target device to the target device or an access proxy unit based on the connection state Steps,
A program that causes a computer to execute.
請求項1ないし20のいずれか一項に記載のアクセス認可装置と、
前記対象機器および前記通信装置の少なくとも一方と
を備えた通信システム。
The access authorization device according to any one of claims 1 to 20,
A communication system comprising: at least one of the target device and the communication device.
前記対象機器と前記通信装置の両方を備えた
請求項23に記載の通信システム。
The communication system according to claim 23, comprising both the target device and the communication device.
JP2016046197A 2015-03-20 2016-03-09 Access authorization apparatus, access authorization method, program and communication system Abandoned JP2016177795A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
US15/069,333 US20160277413A1 (en) 2015-03-20 2016-03-14 Access Permission Device, Access Permission Method, Program, and Communicating System

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
JP2015058684 2015-03-20
JP2015058684 2015-03-20

Publications (1)

Publication Number Publication Date
JP2016177795A true JP2016177795A (en) 2016-10-06

Family

ID=57070736

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2016046197A Abandoned JP2016177795A (en) 2015-03-20 2016-03-09 Access authorization apparatus, access authorization method, program and communication system

Country Status (1)

Country Link
JP (1) JP2016177795A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2018164236A1 (en) * 2017-03-10 2018-09-13 シャープ株式会社 Internet server, terminal, communication system, control method for internet server, and control program
JP2020080482A (en) * 2018-11-13 2020-05-28 シャープ株式会社 Network system, information processing method, communication terminal, and program
US11336449B2 (en) 2018-09-13 2022-05-17 Kabushiki Kaisha Toshiba Information processing apparatus, computer program product, and resource providing method

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2018164236A1 (en) * 2017-03-10 2018-09-13 シャープ株式会社 Internet server, terminal, communication system, control method for internet server, and control program
US11336449B2 (en) 2018-09-13 2022-05-17 Kabushiki Kaisha Toshiba Information processing apparatus, computer program product, and resource providing method
JP2020080482A (en) * 2018-11-13 2020-05-28 シャープ株式会社 Network system, information processing method, communication terminal, and program

Similar Documents

Publication Publication Date Title
US20160277413A1 (en) Access Permission Device, Access Permission Method, Program, and Communicating System
JP6668183B2 (en) Communication device, communication method, communication system and program
KR102318279B1 (en) Method and apparatus for transmitting and receiving authentication information in a wireless communication system
KR102362456B1 (en) Authority transfer system, control method therefor, and storage medium
JP6494149B2 (en) Authorization processing method and device
EP3073699B1 (en) System and method for controlling mutual access of smart devices
CN110138718B (en) Information processing system and control method thereof
JP6929181B2 (en) Devices and their control methods and programs
US10623191B2 (en) Information processing apparatus, information processing system, information processing method, and recording medium
US9413762B2 (en) Asynchronous user permission model for applications
JP6061633B2 (en) Device apparatus, control method, and program thereof.
WO2018177143A1 (en) Identity authentication method and system, server and terminal
US9549318B2 (en) System and method for delayed device registration on a network
US10523763B2 (en) Communication device, communication method, controlled device, and non-transitory computer readable medium
WO2020176356A1 (en) Server-based setup for connecting a device to a local area network
US20160134432A1 (en) Method for setting up a local control channel between a control unit and a building-internal access portal
KR20130001655A (en) Apparatus and method for providing service to different service terminal
US8769623B2 (en) Grouping multiple network addresses of a subscriber into a single communication session
JP2016177795A (en) Access authorization apparatus, access authorization method, program and communication system
US11368994B1 (en) Process for managing reconnections of devices in a network
US10511671B2 (en) Communication device, communication method, controlled device, and non-transitory computer readable medium
JP6056970B2 (en) Information processing apparatus, terminal, information processing system, and information processing method
US20230107045A1 (en) Method and system for self-onboarding of iot devices
KR101117316B1 (en) Remote access service profile setting method and user authentication method for remote accessing UPNP devices
JP2020053100A (en) Information processing system, control method thereof and program

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20180222

A762 Written abandonment of application

Free format text: JAPANESE INTERMEDIATE CODE: A762

Effective date: 20181129

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20181206