OAuth サービス・プロバイダーの定義
OAuth サービス・プロバイダーは、OAuth の名前付き構成オプション・セットです。プロバイダーの id または名前は、許可およびトークン・エンドポイントへのインバウンド要求の URL で指定されます。要求を処理する際に、そのプロバイダーの構成オプション・セットが使用されます。このプロセスにより、1 つのエンドポイント・サーブレットがある 1 つのサーバーで複数の OAuth 構成を効率的に提供できます。例えば、https://my.company.com:8021/oauth2/endpoint/photoShare/authorize URL は、 photoShare という名前の OAuth プロバイダーに定義された OAuth 構成オプション・セットを使用して処理されます。 https://my.company.com:8021/oauth2/endpoint/calendarAuthz/authorize URL は、 calendarAuthz という名前の OAuth プロバイダーに定義された OAuth 構成オプション・セットを使用して処理されます。
このタスクについて
OAuth サービス・プロバイダーは、server.xml ファイル内の oauthProvider エレメントを使用して定義されます。server.xml ファイルを編集するか、WebSphere® Application Server Development Tools for Liberty を使用して、OAuth サービス・プロバイダーを定義できます。このタスクでは、 最小の OAuth 構成を定義する方法を説明します。
手順
タスクの結果
例
<server>
<featureManager>
<feature>oauth-2.0</feature>
<feature>ssl-1.0</feature>
</featureManager>
<keyStore password="keyspass" />
<oauth-roles>
<authenticated>
<user>testuser</user>
</authenticated>
</oauth-roles>
<oauthProvider id="SampleProvider" filter="request-url%=ssodemo">
<localStore>
<client name="client01" secret="{xor}LDo8LTor"
displayname="Test client number 1"
redirect="http://localhost:1234/oauthclient/redirect.jsp"
enabled="true" />
</localStore>
</oauthProvider>
<webAppSecurity allowFailOverToBasicAuth="true"/>
<basicRegistry id="basic" realm="BasicRealm">
<user name="testuser" password="testuserpwd" />
</basicRegistry>
</server>