鷹山 (C)1996-2026 Copyright  データベースアメニティ研究所 ▼ Connected via IPv4
仁科辰夫教授 最終講義 2023.3.17 米沢キャンパス中示A
…

【研究ノート】 差分-Shibboleth IdP (2.0.0 - 2.1.2; StoredID)

一覧戻る進む
研究ノート-差分-Shibboleth Id@1155-差分-Shibboleth IdP (2.0.0 - 2.1.2; StoredID)

シボレス認証によって、このページの感想やコメント、質問などを記入できます。学術認証フェデレーション(学認)参加機関から利用できます。
→ シボレスログイン
→ RSS
シボレス-トップメニュー
学認参加機関/一覧
ページレビュー説明書
山形大学 学術認証-fed

ID⇒#1155@研究ノート;
要約【研究ノート】差分-Shibboleth IdP (2.0.0 - 2.1.2; StoredID)⇒#1155@研究ノート;
日時記録=2009/8/20, 修正=2009/8/24
研究者伊藤 智博
リンク関連外部URL=https://upki-por…, 学認共有URL=, 講義 研究 発表 業績 テーマ 製品 計算式
内容差分-Shibboleth IdP (2.0.0 - 2.1.2; StoredIDDataConnector)

国立情報学研究所1)の山地先生にShibbolethのソースコードの管理ページを教えていただき、Shibboleth IdP 2.0.0 を2.1.2にバージョンアップした2)ときに、StoredIDのフォーマット(生成方法も含む)が変わった原因を調査してみた。Javaは詳しくないので、間違っているかもしれませんが、参考程度にメモっておきます。

edu.internet2.middleware.shibboleth.common.attribute.resolver.provider.dataConnector.StoredIDDataConnector.PersistentIdEntry メソッドが変更なっていました。

do {
log.debug("Generated persistent ID was already assigned to another user, regenerating");
persistentId = UUID.randomUUID().toString();
} while (pidStore.getPersistentIdEntry(persistentId, false) != null);

が追加されているなぁ。

Shibboleth IdPのログにも、
DEBUG [edu.internet2.middleware.shibboleth.common.attribute.resolver.provid
er.dataConnector.StoredIDDataConnector:258] - Generated persistent ID was already assigned
to another user, regenerating

のが残っているな、DB空にしたのになぁ???

もしかして、JavaでDo { } while (式) 文を使うときは、最初の1ループは実行するという構文じゃないのかなぁ?
そうだとしたら、この行は常に実行されるから、正常動作ってことかなぁ?

原因はここくさいなぁ。あとは、仕様との問題だけなんで、ひとまず、様子を見てみよう。

〇Version 1.0.0
http://svn.middl…

〇Version 1.1.2
http://svn.middl…

〇Version 1.0.0
protected PersistentIdEntry createPersistentId(ShibbolethResolutionContext resolutionContext, String localId,
byte[] salt) throws SQLException {
PersistentIdEntry entry = pidStore.new PersistentIdEntry();
entry.setLocalEntityId(resolutionContext.getAttributeRequestContext().getLocalEntityId());
entry.setPeerEntityId(resolutionContext.getAttributeRequestContext().getInboundMessageIssuer());
entry.setPrincipalName(resolutionContext.getAttributeRequestContext().getPrincipalName());
entry.setLocalId(localId);

String persisentId;
int numberOfExistingEntries = pidStore.getNumberOfPersistentIdEntries(entry.getLocalEntityId(), entry
.getPeerEntityId(), entry.getLocalId());
if (numberOfExistingEntries == 0) {
try {
MessageDigest md = MessageDigest.getInstance("SHA");
md.update(entry.getPeerEntityId().getBytes());
md.update((byte) '!');
md.update(localId.getBytes());
md.update((byte) '!');
persisentId = Base64.encodeBytes(md.digest(salt));
} catch (NoSuchAlgorithmException e) {
log.error("JVM error, SHA-1 is not supported, unable to compute ID");
throw new SQLException("SHA-1 is not supported, unable to compute ID");
}
} else {
persisentId = UUID.randomUUID().toString();
}
entry.setPersistentId(persisentId);

entry.setCreationTime(new Timestamp(System.currentTimeMillis()));

return entry;
}

〇Version 1.1.2
protected PersistentIdEntry createPersistentId(ShibbolethResolutionContext resolutionContext, String localId,
byte[] salt) throws SQLException {
PersistentIdEntry entry = pidStore.new PersistentIdEntry();
entry.setLocalEntityId(resolutionContext.getAttributeRequestContext().getLocalEntityId());
entry.setPeerEntityId(resolutionContext.getAttributeRequestContext().getInboundMessageIssuer());
entry.setPrincipalName(resolutionContext.getAttributeRequestContext().getPrincipalName());
entry.setLocalId(localId);

String persistentId;
int numberOfExistingEntries = pidStore.getNumberOfPersistentIdEntries(entry.getLocalEntityId(), entry
.getPeerEntityId(), entry.getLocalId());
if (numberOfExistingEntries == 0) {
try {
MessageDigest md = MessageDigest.getInstance("SHA");
md.update(entry.getPeerEntityId().getBytes());
md.update((byte) '!');
md.update(localId.getBytes());
md.update((byte) '!');
persistentId = Base64.encodeBytes(md.digest(salt));
} catch (NoSuchAlgorithmException e) {
log.error("JVM error, SHA-1 is not supported, unable to compute ID");
throw new SQLException("SHA-1 is not supported, unable to compute ID");
}
} else {
persistentId = UUID.randomUUID().toString();
}

do {
log.debug("Generated persistent ID was already assigned to another user, regenerating");
persistentId = UUID.randomUUID().toString();
} while (pidStore.getPersistentIdEntry(persistentId, false) != null);

entry.setPersistentId(persistentId);

entry.setCreationTime(new Timestamp(System.currentTimeMillis()));

return entry;
}

山地先生、アドバイスを頂き、ありがとうございます。

【関連講義】サイバーキャンパス「鷹山」,UPKI関係資料3)

研究ノート
◆Shibboleth IdP 2.1.2へのバージョンアップの検証
◆Dynamic VLAN 属性
◆学術認証フェデレーションに対応するためのメタデータの更新作業
◆差分-Shibboleth IdP (2.0.0 - 2.1.2; StoredID)
◆Shibboleth IdP 2.1.3へのバージョンアップ
◆eduroam利用可能エリア-ルポ(国際高等セミナーハウス)
◆UPKI用Shibboleth IdPの構築記録(OS環境の設定 No.3)
◆【エラー解説】Shibboleth IdP 2.1.3 (tomcat関係-1)
◆【エラー解説】Shibboleth IdP 2.1.3  (tomcat関係-2)
◆【不具合】Windowsサーバ2003でShibboleth SPを構築するとコンテンツが破壊
◆Shibboleth IdP StoredID用のテーブルの作成 (MySQL)
◆Shibboleth IdPでBase64に変換する方法
◆【エラー解説】 Shibboleth SP 2.2.1 for x64, IIS
◆SAML1ScopedStringAttributeEncoderをScriptに変更するときの注意
◆IIS上にShibboleth SPを構築したときに属性情報の文字化けを修正する方法
◆eduroam試験結果(Windows系ノート)
研究ノート…
…
…
…
…
Shibboleth IdPサーバ
…
試料…
試料使用履歴…
ページレビュー※
シボレスページレビュー…/一覧
HyperLink