decode button
This commit is contained in:
parent
b77c02b171
commit
1a956b4e25
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
## [v1.2.0] - 2023-03-20
|
## [v1.2.0] - 2023-03-20
|
||||||
|
|
||||||
- TODO:
|
- Decode Button
|
||||||
|
|
||||||
## [v1.0.1] - 2022-05-25
|
## [v1.0.1] - 2022-05-25
|
||||||
|
|
||||||
|
|
|
@ -10,12 +10,27 @@ pageContext.setAttribute("userGroups", userGroups);
|
||||||
|
|
||||||
List<String> userContexts = (List<String>) request.getAttribute("userContexts");
|
List<String> userContexts = (List<String>) request.getAttribute("userContexts");
|
||||||
pageContext.setAttribute("userContexts", userContexts);
|
pageContext.setAttribute("userContexts", userContexts);
|
||||||
|
|
||||||
%>
|
%>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
|
||||||
|
function decodeFunction(token) {
|
||||||
|
var token = $("#tokenResult").val();
|
||||||
|
|
||||||
|
$('#txt_name').val();
|
||||||
|
|
||||||
|
window.open(
|
||||||
|
"https://jwt.io/#id_token=" + token,
|
||||||
|
'_blank' // <- This is what makes it open in a new window.
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
function getUMAToken(endpoint) {
|
function getUMAToken(endpoint) {
|
||||||
console.log("getUMAToken:" + endpoint);
|
console.log("getUMAToken:" + endpoint);
|
||||||
$('#umaButton').attr("disabled", true);
|
$('#umaButton').attr("disabled", true);
|
||||||
$('#buttonCopy').hide();
|
$('#buttonCopy').hide();
|
||||||
|
$('#div_decode').hide();
|
||||||
|
|
||||||
var selectedContext = $("#myselect").val();
|
var selectedContext = $("#myselect").val();
|
||||||
$('#tokenResult').text('');
|
$('#tokenResult').text('');
|
||||||
$.ajax({
|
$.ajax({
|
||||||
|
@ -30,6 +45,11 @@ pageContext.setAttribute("userContexts", userContexts);
|
||||||
if (resultObject.success) {
|
if (resultObject.success) {
|
||||||
$('#tokenResult').text(resultObject.comment);
|
$('#tokenResult').text(resultObject.comment);
|
||||||
$('#buttonCopy').show();
|
$('#buttonCopy').show();
|
||||||
|
$('#div_decode').show();
|
||||||
|
|
||||||
|
//console.log("resultObject", resultObject)
|
||||||
|
|
||||||
|
$('jsonresp').html(resultObject)
|
||||||
} else {
|
} else {
|
||||||
$('#tokenResult').text(resultObject.comment);
|
$('#tokenResult').text(resultObject.comment);
|
||||||
$('#tokenResult').css('color', 'red');
|
$('#tokenResult').css('color', 'red');
|
||||||
|
@ -70,12 +90,16 @@ pageContext.setAttribute("userContexts", userContexts);
|
||||||
<button id="buttonCopy" class="btn btn-mini" onclick="copyFunction()">
|
<button id="buttonCopy" class="btn btn-mini" onclick="copyFunction()">
|
||||||
<i class="icon-copy"></i> Copy
|
<i class="icon-copy"></i> Copy
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
<textarea style="width: 90%;" 300px; margin: 10px;" id="tokenResult"></textarea>
|
<textarea style="width: 90%;" 300px; margin: 10px;" id="tokenResult"></textarea>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div id="div_decode">
|
||||||
You can use <a href="https://jwt.io/" target="blank">https://jwt.io/</a>
|
You can use <a href="https://jwt.io/#debugger-io" target="blank">https://jwt.io/</a>
|
||||||
to decode.
|
to <button id="buttonDecode" class="btn btn-mini" onclick="decodeFunction()">
|
||||||
|
<i class="icon-repository"></i> Decode
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<script>
|
<script>
|
||||||
$('#buttonCopy').hide();
|
$('#buttonCopy').hide();
|
||||||
|
$('#div_decode').hide();
|
||||||
</script>
|
</script>
|
||||||
|
|
Loading…
Reference in New Issue