-
Notifications
You must be signed in to change notification settings - Fork 167
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Option to select AuthnContextClassRef for the SAML response
- Loading branch information
Showing
13 changed files
with
161 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
mujina-idp/src/main/java/mujina/config/AuthnContextClassRefs.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package mujina.config; | ||
|
||
import lombok.Getter; | ||
import lombok.Setter; | ||
import org.springframework.boot.context.properties.ConfigurationProperties; | ||
import org.springframework.stereotype.Component; | ||
|
||
import java.util.List; | ||
|
||
@Component | ||
@ConfigurationProperties(prefix = "acr") | ||
@Getter | ||
@Setter | ||
public class AuthnContextClassRefs { | ||
|
||
private List<String> values; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,73 +1,79 @@ | ||
function guid() { | ||
function s4() { | ||
return Math.floor((1 + Math.random()) * 0x10000) | ||
.toString(16) | ||
.substring(1); | ||
} | ||
function s4() { | ||
return Math.floor((1 + Math.random()) * 0x10000) | ||
.toString(16) | ||
.substring(1); | ||
} | ||
|
||
return s4() + s4() + '-' + s4() + '-' + s4() + '-' + s4() + '-' + s4() + s4() + s4(); | ||
return s4() + s4() + '-' + s4() + '-' + s4() + '-' + s4() + '-' + s4() + s4() + s4(); | ||
} | ||
|
||
document.addEventListener("DOMContentLoaded", function () { | ||
[].forEach.call(document.querySelectorAll(".help,.close"), function (el) { | ||
el.addEventListener("click", function (e) { | ||
e.stopPropagation(); | ||
e.preventDefault(); | ||
var explanation = document.getElementById("explanation"); | ||
explanation.classList.toggle("hide"); | ||
if (!explanation.classList.contains("hide")) { | ||
setTimeout(function () { | ||
document.getElementById("close").focus(); | ||
}, 25); | ||
} | ||
[].forEach.call(document.querySelectorAll(".help,.close"), function (el) { | ||
el.addEventListener("click", function (e) { | ||
e.stopPropagation(); | ||
e.preventDefault(); | ||
var explanation = document.getElementById("explanation"); | ||
explanation.classList.toggle("hide"); | ||
if (!explanation.classList.contains("hide")) { | ||
setTimeout(function () { | ||
document.getElementById("close").focus(); | ||
}, 25); | ||
} | ||
}); | ||
}); | ||
}); | ||
|
||
document.getElementById("close").addEventListener("blur", function () { | ||
document.getElementById("explanation").classList.add("hide"); | ||
}); | ||
document.getElementById("close").addEventListener("blur", function () { | ||
document.getElementById("explanation").classList.add("hide"); | ||
}); | ||
|
||
document.querySelector(".attribute-select").addEventListener("change", function (e) { | ||
var val = e.target.value; | ||
var selectedOption = document.querySelector('option[value="' + val + '"]'); | ||
var text = selectedOption.text; | ||
var multiplicity = selectedOption.dataset.multiplicity === "true"; | ||
var newElement = document.createElement("li"); | ||
newElement.setAttribute("class", "attribute-value"); | ||
var mainId = guid(); | ||
newElement.setAttribute("id", mainId); | ||
var spanId = guid(); | ||
var inputId = guid(); | ||
newElement.innerHTML = "<label>" + val + "</label>" + | ||
"<input class='input-attribute-value' type='text' id='" + inputId + "' name='" + val + "'>" + | ||
"<span id='" + spanId + "' class='remove-attribute-value'>🗑</span>"; | ||
document.getElementById("attribute-list").appendChild(newElement); | ||
document.getElementById(spanId).addEventListener("click", function () { | ||
var element = document.getElementById(mainId); | ||
element.parentNode.removeChild(element); | ||
if (!multiplicity) { | ||
var select = document.getElementById("add-attribute"); | ||
var option = document.createElement("option"); | ||
option.text = text; | ||
option.value = val; | ||
select.add(option); | ||
} | ||
document.querySelector(".acr-select").addEventListener("change", function (e) { | ||
var val = e.target.value; | ||
var acrSelect = document.getElementById("authn-context-class-ref-value"); | ||
acrSelect.value = val; | ||
}); | ||
var select = document.getElementById("add-attribute"); | ||
if (!multiplicity) { | ||
select.remove(select.selectedIndex); | ||
} | ||
select.value = "Add attribute..."; | ||
setTimeout(function () { | ||
var inputElement = document.getElementById(inputId); | ||
inputElement.focus(); | ||
inputElement.addEventListener("keypress", function (e) { | ||
if (e.code === "Enter") { | ||
e.stopPropagation(); | ||
e.preventDefault(); | ||
select.focus(); | ||
|
||
document.querySelector(".attribute-select").addEventListener("change", function (e) { | ||
var val = e.target.value; | ||
var selectedOption = document.querySelector('option[value="' + val + '"]'); | ||
var text = selectedOption.text; | ||
var multiplicity = selectedOption.dataset.multiplicity === "true"; | ||
var newElement = document.createElement("li"); | ||
newElement.setAttribute("class", "attribute-value"); | ||
var mainId = guid(); | ||
newElement.setAttribute("id", mainId); | ||
var spanId = guid(); | ||
var inputId = guid(); | ||
newElement.innerHTML = "<label>" + val + "</label>" + | ||
"<input class='input-attribute-value' type='text' id='" + inputId + "' name='" + val + "'>" + | ||
"<span id='" + spanId + "' class='remove-attribute-value'>🗑</span>"; | ||
document.getElementById("attribute-list").appendChild(newElement); | ||
document.getElementById(spanId).addEventListener("click", function () { | ||
var element = document.getElementById(mainId); | ||
element.parentNode.removeChild(element); | ||
if (!multiplicity) { | ||
var select = document.getElementById("add-attribute"); | ||
var option = document.createElement("option"); | ||
option.text = text; | ||
option.value = val; | ||
select.add(option); | ||
} | ||
}); | ||
var select = document.getElementById("add-attribute"); | ||
if (!multiplicity) { | ||
select.remove(select.selectedIndex); | ||
} | ||
}); | ||
}, 25); | ||
}); | ||
select.value = "Add attribute..."; | ||
setTimeout(function () { | ||
var inputElement = document.getElementById(inputId); | ||
inputElement.focus(); | ||
inputElement.addEventListener("keypress", function (e) { | ||
if (e.code === "Enter") { | ||
e.stopPropagation(); | ||
e.preventDefault(); | ||
select.focus(); | ||
} | ||
}); | ||
}, 25); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.