オートデスクのクラウド サービスと連携するような Forge アプリ/サービスを開発する場合、3-legged OAuth を使って Forge アプリが認証を得た後、特定のユーザからの認可を得て、本来そのユーザしかアクセス出来ないストレージ領域にアクセスするのが一般的です。
この考え方は、過去のブログ記事 Forge での OAuth 認証シナリオ でご案内していますが、Data Management API の API Basics ページの Authentication and Scopes セクションにも一般的なアクセス方法として記述されています(黄色箇所)。
Authentication and Scopes
The Data Management API requires the use of OAuth2 bearer tokens. See the OAuth documentation for more information on authentication, obtaining a bearer token, and scopes.
In general, access to BIM 360 Team, BIM 360 Docs, Fusion Team, and A360 Personal data requires the use of a 3-legged OAuth2 token.
HTTP GET
requests to the Project and Data services require the data:read
scope.
HTTP POST
requests to the Data service require the data:create
scope, but can also be called with the data:write
scope.
もちろん、このシナリオに沿って 3-legged OAuth を実装された Forge アプリ/サービスは、特定のユーザ領域にはアクセスすることが可能です。
ところが、Data Management API の API Basics ページ冒頭には、次のようにも書かれています(黄色箇所)。
API Basics
There are two key data access paradigms that make up the Data Management API.
- Accessing data from Autodesk SaaS applications using any of the Data Management services.
- For BIM 360 Team, Fusion Team, and A360 Personal, end users need to provide 3-legged authenticationfor your app to access the data.
- For BIM 360 Docs, an account administrator needs to add an integration with your app in BIM 360 Enterprise. You can access data using either 2-legged or 3-legged authentication.
- Managing and storing files from your app on the Forge platform, independent of any Autodesk SaaS application. You need to use the Object Storage service (OSS).
前半の BIM 360 Docs のアプリ統合の説明は、BIM 360 Docs と Data Management API アクセス と Forge アプリを BIM 360 と連携するための「カスタム統合機能」の注意点 に譲りますが、問題は後半の説明です。曰く、(BIM 360 Docs の)データにアクセスするには、2-legged 認証または、3-legged 認証のいずれかを使用出来る、とあります。
これは、BIM 360 Docs 統合アプリの役割を考えると自明です。Forge アプリ/サービスが特定のユーザ ストレージにあるデータしか扱えない場合、それは、ある意味、BIM 360 Docs と同じ情報しか提供することが出来ないことを意味します。
BIM 360 Docs 統合アプリには、開発者に選択によって、いずれかの振る舞いを持てるような実装方法が用意されています。
すなわち、2-legged OAuth を使って Access Token を得たアプリ/サービスは、BIM 360 Docs のすべてのデータにアクセスすることが出来ます。
また、3-legged OAuth を使ってトークンを Access Token を得たアプリ/サービスは、エンド ユーザ認可を得た特定のユーザ領域にあるデータのみにアクセスすることが出来ます。
昨年、Autodesk University Japan 2018 と併設した Forge DevCon Japan の 1G-4 BIM 360 & Forge:建設におけるコラボレーションの将来に向けて セッション資料の P21で触れられているのはこの点です。
もちろん、 2-legged OAuth を使ってすべてのデータを得た場合でも、そのアプリのエンドユーザにすべてのデータを開示するか否か、開示する場合でも、どのように表示するかなどは、開発者が持つの意図に依存することになります。
By Toshiaki Isezaki
コメント