◀
戻る
進む
▶
🗒️
差分-Shibboleth IdP (2.0.0 - 2.1.2; StoredID)
⇒#1155@研究ノート;
#差
差分-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)
高等学校 >
高校公民 >
政治・経 >
独立行政 >
大学共同 >
国立情報学研究所,
大学共同利用機関法人仁科 辰夫,
電気化学の庵,
講義ノート, (
2008).
Shibboleth IdP 2.1.2へのバージョンアップ伊藤智博,
研究ノート, (
2009).
高等学校 >
高校公民 >
政治・経 >
独立行政 >
大学共同 >
国立情報 >
UPKI >
UPKI関係資料,
UPKI-シングルサインオン(SSO)実証実験仁科 辰夫,
サイバーキャンパス「鷹山,
講義ノート, (
2009).
(
1) 
高等学校 >
高校公民 >
政治・経 >
独立行政 >
大学共同 >
国立情報学研究所,
大学共同利用機関法人仁科 辰夫,
電気化学の庵,
講義ノート, (
2008).
(
2) 
Shibboleth IdP 2.1.2へのバージョンアップ伊藤智博,
研究ノート, (
2009).
(
3) 
高等学校 >
高校公民 >
政治・経 >
独立行政 >
大学共同 >
国立情報 >
UPKI >
UPKI関係資料,
UPKI-シングルサインオン(SSO)実証実験仁科 辰夫,
サイバーキャンパス「鷹山,
講義ノート, (
2009).
表器具・消耗品(履歴)表サンプル(履歴)表装置(履歴)
西暦と元号
実験ノート、報告書、論文
表
2
.
実験ノート、報告書、論文
項目 |
実験ノート |
報告書
|
論文
|
|
|
|
|
目的
|
記録。証拠保全。
|
報告。
|
出版。
|
著作権
|
グラフや表などで、著者の創造性が認められるもの
|
グラフや表などで、著者の創造性が認められるもの
|
全体が著作物
|
時制
|
時系列に沿って書く。
日付を忘れずに。
|
目的、方法、結果の順に書く。
目的、結論の順の場合も。
今後の方針や計画を含む
|
完全完結。
今後の方針や計画は無し。
|
<a href="https://edu.yz.yamagata-u.ac.jp/developer/Asp/Youzan/Physics/Calendar.asp?date=2009-08-20">
<time datetime="2009-08-20">
2009-08-20
</time>
</a>
<a href="https://edu.yz.yamagata-u.ac.jp/developer/Asp/Youzan/Laboratory/LaboNote/@LaboNote.asp?id=1155">
差分-Shibboleth IdP (2.0.0 - 2.1.2; StoredID)
</a>
🎄🎂🌃🕯🎉