keytool -genkeypair -alias java-saml-dev -keyalg RSA -keysize 2048 -sigalg SHA256withRSA -validity 1095 -storetype PKCS12 -keystore AzureAppCert.pfx -dname "CN=java-dev.tomori-tech.com, O=Tomori-tech, C=JP"
keytool -exportcert -rfc -alias java-saml-dev -storetype PKCS12 -keystore AzureAppCert.pfx -file AzureAppCert.cer
keytool -certreq -alias java-saml-dev -storetype PKCS12 -keystore AzureAppCert.pfx -sigalg SHA256withRSA -file AzureAppCert.csr

エンタープライズ アプリケーションに入る

ユーザーに表示する場合、https://myapplications.microsoft.com/ から見れる


割り当てする場合、ユーザー/グループの設定が必要

SAML設定はメタデータXMLのインポートより設定可能、メタデータXMLがない場合、
設定項目を一個ずつ手作業で設定必要、設定方法は下記:

開発環境の場合、URLにはlocalhostを利用
サインオンURLはhttps://myapplications.microsoft.com/ のアイコンのリンク


※localhost以外にhttpsが必要
CAのルート証明書を端末にインストールしない場合:






通知メールアドレスは5つまで

自動生成された証明書はURLでアクセス、またはxmlファイル(PublicKey含む)をダウンロードして使う(証明書1ペア目:Azure側PrivateKey、業務アプリ側PublicKey)

生成した証明書はここで使う、SAMLトークンを暗号化するため(2ペア目:Azure側PublicKey、業務アプリ側PrivateKey)


赤枠:生成した証明書はここで使う、アクセストークンを取得するため(3ペア目:Azure側PublicKey、業務アプリ側PrivateKey)
青枠:SAMLトークン暗号化用Key、2ペア目、ここにも表示


登録アプリのID情報を抑えてプログラムで利用する
プログラミング用jarファイル
[ 1] jackson-annotations-2.22.jar
groupId : com.fasterxml.jackson.core
用途 : JSON マッピング用のアノテーション定義。jackson-databind が参照
https://repo1.maven.org/maven2/com/fasterxml/jackson/core/jackson-annotations/2.22/jackson-annotations-2.22.jar
[ 2] jackson-core-2.22.1.jar
groupId : com.fasterxml.jackson.core
用途 : JSON の低レベル読み書き(パーサ・ジェネレータ)
https://repo1.maven.org/maven2/com/fasterxml/jackson/core/jackson-core/2.22.1/jackson-core-2.22.1.jar
[ 3] jackson-databind-2.22.1.jar
groupId : com.fasterxml.jackson.core
用途 : JSON ⇔ Java オブジェクト変換。pac4j が内部設定とプロファイルの直列化に使用
https://repo1.maven.org/maven2/com/fasterxml/jackson/core/jackson-databind/2.22.1/jackson-databind-2.22.1.jar
[ 4] jackson-datatype-jsr310-2.22.1.jar
groupId : com.fasterxml.jackson.datatype
用途 : Java 8 日時型(Instant 等)の JSON 対応
https://repo1.maven.org/maven2/com/fasterxml/jackson/datatype/jackson-datatype-jsr310/2.22.1/jackson-datatype-jsr310-2.22.1.jar
[ 5] java-jwt-4.6.0.jar
groupId : com.auth0
用途 : クライアントアサーション(JWT)の生成と RS256 署名。ユーザ情報取得WebAPI 用アクセストークンの取得に使用
https://repo1.maven.org/maven2/com/auth0/java-jwt/4.6.0/java-jwt-4.6.0.jar
[ 6] jsr305-3.0.2.jar
groupId : com.google.code.findbugs
用途 : @Nullable 等のアノテーション定義。Guava が参照
https://repo1.maven.org/maven2/com/google/code/findbugs/jsr305/3.0.2/jsr305-3.0.2.jar
[ 7] error_prone_annotations-2.47.0.jar
groupId : com.google.errorprone
用途 : 静的解析用のアノテーション定義。Guava が参照
https://repo1.maven.org/maven2/com/google/errorprone/error_prone_annotations/2.47.0/error_prone_annotations-2.47.0.jar
[ 8] failureaccess-1.0.3.jar
groupId : com.google.guava
用途 : Guava の内部ユーティリティ。Guava から分離された必須サブモジュール
https://repo1.maven.org/maven2/com/google/guava/failureaccess/1.0.3/failureaccess-1.0.3.jar
[ 9] guava-33.6.0-jre.jar
groupId : com.google.guava
用途 : コレクション・キャッシュ等の汎用ライブラリ。OpenSAML と pac4j が使用
https://repo1.maven.org/maven2/com/google/guava/guava/33.6.0-jre/guava-33.6.0-jre.jar
[10] listenablefuture-9999.0-empty-to-avoid-conflict-with-guava.jar
groupId : com.google.guava
用途 : 依存衝突回避用の空 jar(中身なし・約 2KB)。Guava のために必要
https://repo1.maven.org/maven2/com/google/guava/listenablefuture/9999.0-empty-to-avoid-conflict-with-guava/listenablefuture-9999.0-empty-to-avoid-conflict-with-guava.jar
[11] j2objc-annotations-3.1.jar
groupId : com.google.j2objc
用途 : Guava が参照するアノテーション定義
https://repo1.maven.org/maven2/com/google/j2objc/j2objc-annotations/3.1/j2objc-annotations-3.1.jar
[12] commons-codec-1.16.1.jar
groupId : commons-codec
用途 : Base64 / 16進数エンコード。SAML メッセージの符号化に使用
https://repo1.maven.org/maven2/commons-codec/commons-codec/1.16.1/commons-codec-1.16.1.jar
[13] commons-io-2.22.0.jar
groupId : commons-io
用途 : ファイル・ストリーム操作のユーティリティ
https://repo1.maven.org/maven2/commons-io/commons-io/2.22.0/commons-io-2.22.0.jar
[14] metrics-core-4.2.39.jar
groupId : io.dropwizard.metrics
用途 : 実行時メトリクス収集。OpenSAML のストレージ層が使用
https://repo1.maven.org/maven2/io/dropwizard/metrics/metrics-core/4.2.39/metrics-core-4.2.39.jar
[15] metrics-json-4.2.39.jar
groupId : io.dropwizard.metrics
用途 : 上記メトリクスの JSON 出力
https://repo1.maven.org/maven2/io/dropwizard/metrics/metrics-json/4.2.39/metrics-json-4.2.39.jar
[16] shib-networking-9.2.3.jar
groupId : net.shibboleth
用途 : Shibboleth 共通ライブラリ(HTTP 通信)。OpenSAML の基盤
https://build.shibboleth.net/maven/releases/net/shibboleth/shib-networking/9.2.3/shib-networking-9.2.3.jar
[17] shib-security-9.2.3.jar
groupId : net.shibboleth
用途 : Shibboleth 共通ライブラリ(暗号・鍵管理)。OpenSAML の基盤
https://build.shibboleth.net/maven/releases/net/shibboleth/shib-security/9.2.3/shib-security-9.2.3.jar
[18] shib-support-9.2.3.jar
groupId : net.shibboleth
用途 : Shibboleth 共通ライブラリ(汎用ユーティリティ)。OpenSAML の基盤
https://build.shibboleth.net/maven/releases/net/shibboleth/shib-support/9.2.3/shib-support-9.2.3.jar
[19] shib-velocity-9.2.3.jar
groupId : net.shibboleth
用途 : Shibboleth 共通ライブラリ(テンプレート連携)
https://build.shibboleth.net/maven/releases/net/shibboleth/shib-velocity/9.2.3/shib-velocity-9.2.3.jar
[20] commons-lang3-3.20.0.jar
groupId : org.apache.commons
用途 : 文字列・オブジェクト操作の汎用ユーティリティ
https://repo1.maven.org/maven2/org/apache/commons/commons-lang3/3.20.0/commons-lang3-3.20.0.jar
[21] commons-text-1.15.0.jar
groupId : org.apache.commons
用途 : 文字列処理(エスケープ・類似度計算等)
https://repo1.maven.org/maven2/org/apache/commons/commons-text/1.15.0/commons-text-1.15.0.jar
[22] httpclient5-5.6.4.jar
groupId : org.apache.httpcomponents.client5
用途 : HTTP クライアント。IdP フェデレーションメタデータの取得に使用
https://repo1.maven.org/maven2/org/apache/httpcomponents/client5/httpclient5/5.6.4/httpclient5-5.6.4.jar
[23] httpclient5-cache-5.3.1.jar
groupId : org.apache.httpcomponents.client5
用途 : 上記のキャッシュ機構。メタデータの再取得を抑制
https://repo1.maven.org/maven2/org/apache/httpcomponents/client5/httpclient5-cache/5.3.1/httpclient5-cache-5.3.1.jar
[24] httpcore5-5.2.5.jar
groupId : org.apache.httpcomponents.core5
用途 : HttpClient5 の基盤(接続・プロトコル処理)
https://repo1.maven.org/maven2/org/apache/httpcomponents/core5/httpcore5/5.2.5/httpcore5-5.2.5.jar
[25] httpcore5-h2-5.4.3.jar
groupId : org.apache.httpcomponents.core5
用途 : HTTP/2 対応モジュール
https://repo1.maven.org/maven2/org/apache/httpcomponents/core5/httpcore5-h2/5.4.3/httpcore5-h2-5.4.3.jar
[26] xmlsec-3.0.6.jar
groupId : org.apache.santuario
用途 : 【重要】Apache Santuario。XML 署名の検証・生成。SAML アサーション署名検証の中核
https://repo1.maven.org/maven2/org/apache/santuario/xmlsec/3.0.6/xmlsec-3.0.6.jar
[27] velocity-engine-core-2.4.1.jar
groupId : org.apache.velocity
用途 : テンプレートエンジン。SAML の HTTP-POST バインディング用フォーム生成に使用
https://repo1.maven.org/maven2/org/apache/velocity/velocity-engine-core/2.4.1/velocity-engine-core-2.4.1.jar
[28] bcpkix-jdk18on-1.85.jar
groupId : org.bouncycastle
用途 : Bouncy Castle。証明書と PKCS#12 の処理。SP 鍵ストア読み込みに使用
https://repo1.maven.org/maven2/org/bouncycastle/bcpkix-jdk18on/1.85/bcpkix-jdk18on-1.85.jar
[29] bcprov-jdk18on-1.85.jar
groupId : org.bouncycastle
用途 : Bouncy Castle 暗号プロバイダ本体(RSA・SHA-256 等)
https://repo1.maven.org/maven2/org/bouncycastle/bcprov-jdk18on/1.85/bcprov-jdk18on-1.85.jar
[30] bcutil-jdk18on-1.85.jar
groupId : org.bouncycastle
用途 : Bouncy Castle 共通ユーティリティ
https://repo1.maven.org/maven2/org/bouncycastle/bcutil-jdk18on/1.85/bcutil-jdk18on-1.85.jar
[31] cryptacular-1.3.0.jar
groupId : org.cryptacular
用途 : 暗号処理の高水準ラッパー。OpenSAML が使用
https://repo1.maven.org/maven2/org/cryptacular/cryptacular/1.3.0/cryptacular-1.3.0.jar
[32] jakarta.json-2.0.1.jar
groupId : org.glassfish
用途 : JSON 処理の実装。OpenSAML のストレージ層が実行時に使用
https://repo1.maven.org/maven2/org/glassfish/jakarta.json/2.0.1/jakarta.json-2.0.1.jar
[33] jspecify-1.0.0.jar
groupId : org.jspecify
用途 : null 安全性に関するアノテーション定義
https://repo1.maven.org/maven2/org/jspecify/jspecify/1.0.0/jspecify-1.0.0.jar
[34] opensaml-core-api-5.2.3.jar
groupId : org.opensaml
用途 : OpenSAML 共通 API(XML オブジェクトモデル)
https://build.shibboleth.net/maven/releases/org/opensaml/opensaml-core-api/5.2.3/opensaml-core-api-5.2.3.jar
[35] opensaml-core-impl-5.2.3.jar
groupId : org.opensaml
用途 : opensaml-core-api の実装
https://build.shibboleth.net/maven/releases/org/opensaml/opensaml-core-impl/5.2.3/opensaml-core-impl-5.2.3.jar
[36] opensaml-messaging-api-5.2.3.jar
groupId : org.opensaml
用途 : メッセージ処理パイプラインの API
https://build.shibboleth.net/maven/releases/org/opensaml/opensaml-messaging-api/5.2.3/opensaml-messaging-api-5.2.3.jar
[37] opensaml-messaging-impl-5.2.3.jar
groupId : org.opensaml
用途 : opensaml-messaging-api の実装
https://build.shibboleth.net/maven/releases/org/opensaml/opensaml-messaging-impl/5.2.3/opensaml-messaging-impl-5.2.3.jar
[38] opensaml-profile-api-5.2.3.jar
groupId : org.opensaml
用途 : プロファイル処理の API
https://build.shibboleth.net/maven/releases/org/opensaml/opensaml-profile-api/5.2.3/opensaml-profile-api-5.2.3.jar
[39] opensaml-profile-impl-5.2.3.jar
groupId : org.opensaml
用途 : opensaml-profile-api の実装
https://build.shibboleth.net/maven/releases/org/opensaml/opensaml-profile-impl/5.2.3/opensaml-profile-impl-5.2.3.jar
[40] opensaml-saml-api-5.2.3.jar
groupId : org.opensaml
用途 : 【重要】SAML 2.0 の型・API 定義
https://build.shibboleth.net/maven/releases/org/opensaml/opensaml-saml-api/5.2.3/opensaml-saml-api-5.2.3.jar
[41] opensaml-saml-impl-5.2.3.jar
groupId : org.opensaml
用途 : 【重要】SAML 2.0 の実装。アサーションの解析と検証を担当
https://build.shibboleth.net/maven/releases/org/opensaml/opensaml-saml-impl/5.2.3/opensaml-saml-impl-5.2.3.jar
[42] opensaml-security-api-5.2.3.jar
groupId : org.opensaml
用途 : 鍵・証明書・信頼性評価の API
https://build.shibboleth.net/maven/releases/org/opensaml/opensaml-security-api/5.2.3/opensaml-security-api-5.2.3.jar
[43] opensaml-security-impl-5.2.3.jar
groupId : org.opensaml
用途 : opensaml-security-api の実装
https://build.shibboleth.net/maven/releases/org/opensaml/opensaml-security-impl/5.2.3/opensaml-security-impl-5.2.3.jar
[44] opensaml-soap-api-5.2.3.jar
groupId : org.opensaml
用途 : SOAP バインディングの API
https://build.shibboleth.net/maven/releases/org/opensaml/opensaml-soap-api/5.2.3/opensaml-soap-api-5.2.3.jar
[45] opensaml-soap-impl-5.2.3.jar
groupId : org.opensaml
用途 : opensaml-soap-api の実装
https://build.shibboleth.net/maven/releases/org/opensaml/opensaml-soap-impl/5.2.3/opensaml-soap-impl-5.2.3.jar
[46] opensaml-storage-api-5.2.3.jar
groupId : org.opensaml
用途 : 一時データ保存の API(リプレイ防止用の ID 記録等)
https://build.shibboleth.net/maven/releases/org/opensaml/opensaml-storage-api/5.2.3/opensaml-storage-api-5.2.3.jar
[47] opensaml-storage-impl-5.2.3.jar
groupId : org.opensaml
用途 : opensaml-storage-api の実装
https://build.shibboleth.net/maven/releases/org/opensaml/opensaml-storage-impl/5.2.3/opensaml-storage-impl-5.2.3.jar
[48] opensaml-xmlsec-api-5.2.3.jar
groupId : org.opensaml
用途 : XML 署名・暗号の API
https://build.shibboleth.net/maven/releases/org/opensaml/opensaml-xmlsec-api/5.2.3/opensaml-xmlsec-api-5.2.3.jar
[49] opensaml-xmlsec-impl-5.2.3.jar
groupId : org.opensaml
用途 : opensaml-xmlsec-api の実装
https://build.shibboleth.net/maven/releases/org/opensaml/opensaml-xmlsec-impl/5.2.3/opensaml-xmlsec-impl-5.2.3.jar
[50] javaee-pac4j-8.0.3.jar
groupId : org.pac4j
用途 : 【重要】Servlet(javax) 連携。SecurityFilter / CallbackFilter / LogoutFilter を提供
https://repo1.maven.org/maven2/org/pac4j/javaee-pac4j/8.0.3/javaee-pac4j-8.0.3.jar
[51] pac4j-core-6.5.6.jar
groupId : org.pac4j
用途 : 【重要】pac4j 中核。認証フロー制御とユーザープロファイル管理
https://repo1.maven.org/maven2/org/pac4j/pac4j-core/6.5.6/pac4j-core-6.5.6.jar
[52] pac4j-javaee-6.5.6.jar
groupId : org.pac4j
用途 : pac4j の javax.servlet 向けアダプタ
https://repo1.maven.org/maven2/org/pac4j/pac4j-javaee/6.5.6/pac4j-javaee-6.5.6.jar
[53] pac4j-saml-6.5.6.jar
groupId : org.pac4j
用途 : 【重要】SAML 2.0 クライアント実装。本アプリの認証処理の本体
https://repo1.maven.org/maven2/org/pac4j/pac4j-saml/6.5.6/pac4j-saml-6.5.6.jar
[54] jcl-over-slf4j-2.0.18.jar
groupId : org.slf4j
用途 : 旧 Commons Logging の呼び出しを SLF4J に転送するブリッジ
https://repo1.maven.org/maven2/org/slf4j/jcl-over-slf4j/2.0.18/jcl-over-slf4j-2.0.18.jar
[55] slf4j-api-2.0.18.jar
groupId : org.slf4j
用途 : ログ出力の共通 API
https://repo1.maven.org/maven2/org/slf4j/slf4j-api/2.0.18/slf4j-api-2.0.18.jar
[56] slf4j-simple-2.0.18.jar
groupId : org.slf4j
用途 : ログ出力の実装。社内標準が logback 等の場合は差し替え可
https://repo1.maven.org/maven2/org/slf4j/slf4j-simple/2.0.18/slf4j-simple-2.0.18.jar
[57] spring-beans-6.2.19.jar
groupId : org.springframework
用途 : Spring の型定義。pac4j-saml が参照
https://repo1.maven.org/maven2/org/springframework/spring-beans/6.2.19/spring-beans-6.2.19.jar
[58] spring-core-6.2.19.jar
groupId : org.springframework
用途 : Resource 抽象。鍵ストアとメタデータのパス解決に使用
https://repo1.maven.org/maven2/org/springframework/spring-core/6.2.19/spring-core-6.2.19.jar
[59] spring-jcl-6.2.19.jar
groupId : org.springframework
用途 : Spring 内部のログ抽象
https://repo1.maven.org/maven2/org/springframework/spring-jcl/6.2.19/spring-jcl-6.2.19.jar
[60] spring-jdbc-6.2.19.jar
groupId : org.springframework
用途 : spring-orm の依存として必要。本アプリでは DB 未使用
https://repo1.maven.org/maven2/org/springframework/spring-jdbc/6.2.19/spring-jdbc-6.2.19.jar
[61] spring-orm-6.2.19.jar
groupId : org.springframework
用途 : pac4j-saml の依存として必要。本アプリでは ORM 未使用
https://repo1.maven.org/maven2/org/springframework/spring-orm/6.2.19/spring-orm-6.2.19.jar
[62] spring-tx-6.2.19.jar
groupId : org.springframework
用途 : spring-orm の依存として必要。本アプリでは未使用
https://repo1.maven.org/maven2/org/springframework/spring-tx/6.2.19/spring-tx-6.2.19.jar