🏠
🌡️ 📆 令和6年4月28日
戻る 進む

🗒️ 差分-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 🖱 テキスト画像変換

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


西暦と元号

  1 西暦と元号
西暦 令和 🔷 平成 🔷 昭和 🔷 大正 🔷 明治
2004 R-14 H16 S79 T93 M137
2005 R-13 H17 S80 T94 M138
2006 R-12 H18 S81 T95 M139
2007 R-11 H19 S82 T96 M140
2008 R-10 H20 S83 T97 M141
2009 R-9 H21 S84 T98 M142
2010 R-8 H22 S85 T99 M143
2011 R-7 H23 S86 T100 M144
2012 R-6 H24 S87 T101 M145
2013 R-5 H25 S88 T102 M146
2014 R-4 H26 S89 T103 M147
*

参考文献


QRコード
https://edu.yz.yamagata-u.ac.jp/developer/Asp/Youzan/Laboratory/LaboNote/@LaboNote.asp?id=1155
名称: 教育用公開ウェブサービス
URL: 🔗 https://edu.yz.yamagata-u.ac.jp/
管理運用 山形大学 学術情報基盤センター

🎄🎂🌃🕯🎉
名称: サイバーキャンパス「鷹山」
URL: 🔗 http://amenity.yz.yamagata-u.ac.jp/
管理運用 山形大学 データベースアメニティ研究会
〒992-8510 山形県米沢市城南4丁目3-16

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