🏠
🌡️ 📆 令和5年9月25日
戻る 進む

🗒️ 差分-Shibboleth IdP (2.0.0 - 2.1.2; StoredID)

⇒#1155@研究ノート;

日時
関係者(共同研究者)

https://upki-portal.nii.ac.jp/docs/fed

#

-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 () 使うときは最初のループ実行するという構文じゃないのかなぁ?
そうだとしたらこの行は常に実行されるから正常動作ってことかなぁ?

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

〇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)



高等学校 > 高校公民 > 政治・経 > 独立行政 > 大学共同 > 国立情報学研究所,大学共同利用機関法人
仁科 辰夫,電気化学の庵, 講義ノート, (2008).

Shibboleth IdP 2.1.2へのバージョンアップ
伊藤智博, 研究ノート, (2009).

高等学校 > 高校公民 > 政治・経 > 独立行政 > 大学共同 > 国立情報 > UPKI > UPKI関係資料,UPKI-シングルサインオン(SSO)実証実験
仁科 辰夫,サイバーキャンパス「鷹山, 講義ノート, (2009).

(1高等学校 > 高校公民 > 政治・経 > 独立行政 > 大学共同 > 国立情報学研究所,大学共同利用機関法人
仁科 辰夫,電気化学の庵, 講義ノート, (2008).
(2Shibboleth IdP 2.1.2へのバージョンアップ
伊藤智博, 研究ノート, (2009).
(3高等学校 > 高校公民 > 政治・経 > 独立行政 > 大学共同 > 国立情報 > UPKI > UPKI関係資料,UPKI-シングルサインオン(SSO)実証実験
仁科 辰夫,サイバーキャンパス「鷹山, 講義ノート, (2009).

器具・消耗品(履歴)
履歴ID概要
サンプル(履歴)
履歴ID概要
装置(履歴)
履歴ID概要
111

  1 375 🖱 テキスト画像変換

テキストは、文字コードの羅列です。 文字コードを 表示や印刷するには、フォントを使って画像にします。


QRコード
https://edu.yz.yamagata-u.ac.jp/developer/Asp/Youzan/Laboratory/LaboNote/@LaboNote.asp?id=1155

山形大学 データベースアメニティ研究所
〒992-8510 山形県米沢市城南4丁目3-16
3号館(物質化学工学科棟) 3-3301
准教授 伊藤智博
0238-26-3573
http://amenity.yz.yamagata-u.ac.jp/

Copyright ©1996- 2023 Databese Amenity Laboratory of Virtual Research Institute,  Yamagata University All Rights Reserved.