From 08dd316aee0c0558e253a77e10a32f3f3d225920 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miko=C5=82aj=20Pich?= Date: Mon, 14 May 2018 20:56:17 +0200 Subject: [PATCH] Fix adfs login (#110) --- api/src/main/java/io/github/wulkanowy/api/login/Login.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/api/src/main/java/io/github/wulkanowy/api/login/Login.java b/api/src/main/java/io/github/wulkanowy/api/login/Login.java index b8b52438..3ecfb7b6 100644 --- a/api/src/main/java/io/github/wulkanowy/api/login/Login.java +++ b/api/src/main/java/io/github/wulkanowy/api/login/Login.java @@ -130,6 +130,10 @@ public class Login { .parse(certificate.replaceAll(":", ""), "", Parser.xmlParser()) .select("[AttributeName=\"UserInstance\"] samlAttributeValue"); + if (instances.isEmpty()) { // on adfs login + return ""; + } + if (instances.size() < 2) { // 1st index is always `Default` throw new AccountPermissionException("First login detected, specify symbol"); }