すべてのプロダクト
Search
ドキュメントセンター

CloudSSO:例:Shibboleth と CloudSSO のシングルサインオン

最終更新日:Jun 19, 2026

Shibboleth から CloudSSO へのシングルサインオン (SSO) を設定します。

事前準備

Shibboleth、Tomcat、および LDAP サーバーをインストールします。

説明

このトピックに記載されている Shibboleth の設定は、CloudSSO の SSO 設定プロセス全体を理解するための参考情報です。Alibaba Cloud は、Shibboleth の設定に関するコンサルティングサービスを提供していません。

ステップ 1:Alibaba Cloud から SAML SP メタデータの取得

  1. CloudSSO コンソール にログインします。

  2. 左側のナビゲーションペインで、設定をクリックします。

  3. SSO ログイン セクションで、サービスプロバイダー (SP) メタデータファイルをダウンロードし、/opt/shibboleth-idp/metadata/aliyun-cloudsso-metadata.xml に保存します。

    SP の Entity ID を保存し、後で使用します。

ステップ 2:Shibboleth への Alibaba Cloud の登録

/opt/shibboleth-idp/conf/metadata-providers.xml ファイルを設定し、ステップ 1:Alibaba Cloud から SAML SP メタデータの取得 で取得したメタデータファイルを指定して、Alibaba Cloud を Shibboleth に登録します。

<!--
    <MetadataProvider id="LocalMetadata"  xsi:type="FilesystemMetadataProvider" metadataFile="PATH_TO_YOUR_METADATA"/>
-->
<!-- 上記のコメントアウトされたコードを次のコードに置き換えます。 -->
<MetadataProvider id="AliyunMetadata"  xsi:type="FilesystemMetadataProvider" metadataFile="%{idp.home}/metadata/aliyun-cloudsso-metadata.xml"/>

ステップ 3:Shibboleth からのユーザー属性の設定

  1. /opt/shibboleth-idp/conf/services.xml ファイルを変更します。

    デフォルトの設定では attribute-resolver.xml ファイルが使用されますが、これでは不十分です。完全な設定を有効にするには、attribute-resolver-full.xml に置き換えます。

    <value>%{idp.home}/conf/attribute-resolver.xml</value>
    <!-- 上記のコードを次のコードに置き換えます。 -->
    <value>%{idp.home}/conf/attribute-resolver-full.xml</value>
  2. /opt/shibboleth-idp/conf/attribute-resolver-full.xml ファイルを変更します。

    1. ファイル内で、ユーザー情報と共に返される属性を設定します。この例では、mail 属性が返されます。

      <!-- ========================================== -->
      <!--      Attribute Definitions                 -->
      <!-- ========================================== -->
      <!-- Schema: Core schema attributes-->
      <!-- 上記のコメントの後に次のコードを追加します。 -->
      <AttributeDefinition xsi:type="Simple" id="mail">
          <InputDataConnector ref="myLDAP" attributeNames="mail" />
          <AttributeEncoder xsi:type="SAML1String" name="urn:mace:dir:attribute-def:mail" encodeType="false" />
          <AttributeEncoder xsi:type="SAML2String" name="urn:oid:0.9.2342.19200300.100.1.3" friendlyName="mail" encodeType="false" />
      </AttributeDefinition>
    2. ファイル内で、/opt/shibboleth-idp/conf/ldap.properties から設定を読み取り、LDAP 接続を作成します。

      <!-- Example LDAP Connector -->
      <!--
      	<DataConnector id="myLDAP" xsi:type="LDAPDirectory"
      		ldapURL="%{idp.attribute.resolver.LDAP.ldapURL}"
      		baseDN="%{idp.attribute.resolver.LDAP.baseDN}"
      		principal="%{idp.attribute.resolver.LDAP.bindDN}"
      		principalCredential="%{idp.attribute.resolver.LDAP.bindDNCredential}"
      		useStartTLS="%{idp.attribute.resolver.LDAP.useStartTLS:true}"
      		...
      	</DataConnector>
      -->
      <!-- 上記のサンプルコードを次のコードに置き換えます。 -->
      <DataConnector id="myLDAP" xsi:type="LDAPDirectory"
      			   ldapURL="%{idp.attribute.resolver.LDAP.ldapURL}"
      			   baseDN="%{idp.attribute.resolver.LDAP.baseDN}"
      			   principal="%{idp.attribute.resolver.LDAP.bindDN}"
      			   principalCredential="%{idp.attribute.resolver.LDAP.bindDNCredential}"
      			   useStartTLS="%{idp.attribute.resolver.LDAP.useStartTLS}"
      			   connectTimeout="%{idp.attribute.resolver.LDAP.connectTimeout}"
      			   responseTimeout="%{idp.attribute.resolver.LDAP.responseTimeout}">
      	<FilterTemplate>
      		<![CDATA[
      				%{idp.attribute.resolver.LDAP.searchFilter}
      			]]>
      	</FilterTemplate>
      </DataConnector>
  3. /opt/shibboleth-idp/conf/attribute-filter.xml ファイルを変更して、属性フィルターを追加します。

    PolicyRequirementRule タグ内の value 属性を、ステップ 1:Alibaba Cloud から SAML SP メタデータの取得 で取得した Alibaba Cloud の entityID に置き換えます。

    <AttributeFilterPolicyGroup id="ShibbolethFilterPolicy"
    							xmlns="urn:mace:shibboleth:2.0:afp"
    							xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    							xsi:schemaLocation="urn:mace:shibboleth:2.0:afp http://shibboleth.net/schema/idp/shibboleth-afp.xsd">
    <!-- 上記のコードの後に次のコードを追加します。 -->
    <AttributeFilterPolicy id="aliyun">
    	<PolicyRequirementRule xsi:type="Requester" value="[entityID]" />
    	<AttributeRule attributeID="mail">
    		<PermitValueRule xsi:type="ANY" />
    	</AttributeRule>
    </AttributeFilterPolicy>

ステップ 4:SAML NameID の設定

  1. /opt/shibboleth-idp/conf/relying-party.xml ファイルを変更して、Alibaba Cloud の NameID を設定します。

    bean タグ内の relyingPartyIds 属性を、ステップ 1:Alibaba Cloud から SAML SP メタデータの取得 で取得した Alibaba Cloud の entityID に置き換えます。

    <!--
    	Override example that identifies a single RP by name and configures it
    	for SAML 2 SSO without encryption. This is a common "vendor" scenario.
    -->
    <!--
    <bean parent="RelyingPartyByName" c:relyingPartyIds="https://sp.example.org">
    	<property name="profileConfigurations">
    		<list>
    			<bean parent="SAML2.SSO" p:encryptAssertions="false" />
    		</list>
    	</property>
    </bean>
    -->
    <!-- 上記のコメントアウトされたコードを次のコードに置き換えます。 -->
    <bean parent="RelyingPartyByName" c:relyingPartyIds="[entityID]">
        <property name="profileConfigurations">
            <list>
                <bean parent="SAML2.SSO" p:encryptAssertions="false" p:nameIDFormatPrecedence="urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress" />
            </list>
        </property>
    </bean>
  2. /opt/shibboleth-idp/conf/saml-nameid.xml ファイルを変更して、NameID の生成を設定します。

    <!-- 次の 2 つの Bean のコメントを解除して有効にします。 -->
    <bean parent="shibboleth.SAML2AttributeSourcedGenerator"
        p:omitQualifiers="true"
        p:format="urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress"
        p:attributeSourceIds="#{ {'mail'} }" />
    <bean parent="shibboleth.SAML1AttributeSourcedGenerator"
        p:omitQualifiers="true"
        p:format="urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress"
        p:attributeSourceIds="#{ {'mail'} }" />
  3. /opt/shibboleth-idp/conf/saml-nameid.properties ファイルを変更して、NameID のプロパティを設定します。

    idp.nameid.saml2.default = urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress
    idp.persistentId.useUnfilteredAttributes = true
    idp.persistentId.encoding = BASE32

ステップ 5:Shibboleth から SAML IdP メタデータの取得

  1. Tomcat を再起動して、変更を適用します。

  2. https://<your_server_address>/idp/shibboleth にアクセスし、メタデータファイルをローカルコンピューターに保存します。

ステップ 6:CloudSSO での SSO の有効化

  1. CloudSSO コンソールの左側のナビゲーションペインで、設定 をクリックします。

  2. SSO ログイン セクションで、ID プロバイダーの設定 をクリックします。

  3. ID プロバイダーの設定 ダイアログボックスで、Upload Metadata File を選択します。

  4. ファイルのアップロード をクリックして、手順 5: Shibboleth から SAML IdP メタデータを取得する の IdP メタデータファイルをアップロードします。

  5. SSO スイッチをオンにして、SSO を有効にします。

    重要

    SSO を有効化すると、すべての CloudSSO ユーザーのユーザー名とパスワードによるログインが自動的に無効になります。これはグローバル設定であり、一度有効化されると、すべてのユーザーが SSO 経由での認証を行う必要があります。

ステップ 7:CloudSSO でのユーザーの作成

Shibboleth の対応するユーザーと同じ名前のユーザーを CloudSSO で作成します。

  1. CloudSSO コンソールの左側のナビゲーションペインで、メンバー管理 > ユーザーを選択します。

  2. ユーザー ページで、Create User をクリックします。

  3. Create User パネルで、Username を入力します。

    この例では、ユーザー名は testUser@testdomain.alicloud.com です。

  4. ユーザーのステータスを有効にします。

  5. 閉じる をクリックします。

(オプション) ステップ 8:ユーザーへの許可セットの割り当て

SSO 後にユーザーが特定の Resource Directory メンバーアカウント内のリソースにアクセスできるようにするには、許可セットを作成し、それらのアカウントへのアクセス権をユーザーに付与します。

  1. CloudSSO で許可セットを作成して、ポリシーを定義します。

    詳細については、「許可セットの作成」をご参照ください。

  2. ユーザーにメンバーアカウントへのアクセス権を付与します。

    詳細については、「メンバーアカウントへのアクセス権の付与」をご参照ください。

結果の確認

Alibaba Cloud または Shibboleth のいずれかから SSO を開始できます。

  • Alibaba Cloud から SSO を開始する

    1. CloudSSO コンソール概要 ページで、ユーザーログオン URL をコピーします。

    2. 新しいブラウザーで URL を開きます。

    3. [Go] をクリックします。自動的に Shibboleth ログインページにリダイレクトされます。[SSO ログイン] ページが表示され、[エンタープライズアカウントログイン URL] フィールドは自動入力されています。Go ボタンをクリックして、ID プロバイダーのログインページに移動します。

    4. Shibboleth ログオンページで、ユーザー名 (testUser) とパスワードを入力して、ログイン をクリックします。

      システムは自動的に SSO でログインし、CloudSSO ユーザーポータルにリダイレクトします。

    5. 許可セットが割り当てられているメンバーアカウント内のリソースにアクセスします。

  • Shibboleth から SSO を開始する

    1. https://<your_server_address>/idp/profile/SAML2/Unsolicited/SSO?providerId=<entityID> にアクセスします。

      URL 内の <entityID> を、ステップ 1:Alibaba Cloud から SAML SP メタデータの取得 で取得した Alibaba Cloud の entityID に置き換えます。

    2. Shibboleth ログオンページで、ユーザー名 (testUser) とパスワードを入力し、次にログインをクリックします。

      システムは自動的に SSO でログインし、CloudSSO ユーザーポータルにリダイレクトします。

    3. 許可セットが割り当てられているメンバーアカウント内のリソースにアクセスします。

よくある質問

検証中に問題が発生した場合は、/opt/shibboleth-idp/logs/idp-process.log ファイルを確認してください。以下は一般的な問題です。

Shibboleth ログイン成功後のエラー

/opt/shibboleth-idp/logs/idp-process.log ファイルでエラーメッセージを確認してください。エラーが ValidateUsernamePassword に関連している場合は、LDAP 接続設定とデプロイを確認してください。必要なセクションのコメントが解除されていること、および余分なスペースがないことを確認してください。

unable to connect to the ldap」エラーによるログインの失敗

ldap.properties および attribute-resolver-full.xml ファイルの LDAP 接続設定を確認してください。

リダイレクトエラー:「The NameID is missing

ステップ 3:Shibboleth からのユーザー属性の設定 で、ユーザー情報から mail 属性を正しくマッピングしたことを確認してください。また、ステップ 4:SAML NameID の設定NameID が正しく設定されていることを確認してください。

https://<your_server_address>/idp/profile/SAML2/Unsolicited/SSO?providerId=<entityID> での「Unsupported Request」アクセスエラー

entityId が正しく設定されているかどうかを確認してください。entityId は、metadata フォルダー内のメタデータファイル、attribute-filter.xml ファイル、および relying-party.xml ファイルの 3 つの場所で一致している必要があります。

リダイレクトエラー:「The response signature is invalid

Shibboleth メタデータファイルを Alibaba Cloud に再度アップロードしてください。