OAuth 2 PKCE 持久化

This commit is contained in:
Crystal.Sea
2021-10-09 14:28:56 +08:00
parent 121fe4123b
commit eca3367610
12 changed files with 115 additions and 40 deletions

View File

@@ -270,7 +270,7 @@ apps.category=\u7c7b\u578b
apps.protocol.formbased=\u8868\u5355\u8ba4\u8bc1
apps.protocol.desktop=\u684c\u9762\u8ba4\u8bc1
apps.protocol.tokenbased=\u4ee4\u724c\u8ba4\u8bc1
apps.protocol.oauth2.0=OAuth2.0
apps.protocol.oauth2.0=OAuth2.x
apps.protocol.saml2.0=SAML2.0
apps.protocol.ltpa=\u8f7b\u91cf\u7ea7\u8ba4\u8bc1(LTPA)
apps.protocol.cas=CAS\u8ba4\u8bc1

View File

@@ -273,7 +273,7 @@ apps.category=category
apps.protocol.formbased=formbased
apps.protocol.desktop=desktop
apps.protocol.tokenbased=tokenbased
apps.protocol.oauth2.0=OAuth2.0
apps.protocol.oauth2.0=OAuth2.x
apps.protocol.saml2.0=SAML2.0
apps.protocol.ltpa=Lightweight Third-Party(LTPA)
apps.protocol.cas=CAS

View File

@@ -272,7 +272,7 @@ apps.category=\u7c7b\u578b
apps.protocol.formbased=\u8868\u5355\u8ba4\u8bc1
apps.protocol.desktop=\u684c\u9762\u8ba4\u8bc1
apps.protocol.tokenbased=\u4ee4\u724c\u8ba4\u8bc1
apps.protocol.oauth2.0=OAuth2.0
apps.protocol.oauth2.0=OAuth2.x
apps.protocol.saml2.0=SAML2.0
apps.protocol.ltpa=\u8f7b\u91cf\u7ea7\u8ba4\u8bc1(LTPA)
apps.protocol.cas=CAS\u8ba4\u8bc1

View File

@@ -45,7 +45,7 @@
</tr>
<tr>
<th style="width:15%;"><@locale code="apps.protocol"/></th>
<td style="width:35%;">
<td style="width:35%;" id="app_protocol_control">
<span id="protocol_text" >${model.protocol!}</span>
<input type="hidden"class="form-control" id="protocol" name="protocol" title="" value="${model.protocol!}"/>
</td>

View File

@@ -55,7 +55,7 @@
</tr>
<tr>
<th><@locale code="apps.icon"/></th>
<td><img id="iconFileImg" width='30' height='30' src='<@base/>/image/${model.id!}'/>
<td><img id="iconFileImg" height='30' src='<@base/>/image/${model.id!}'/>
</td>
<th><@locale code="common.text.sortindex"/></th>
<td>

View File

@@ -17,6 +17,8 @@
};
var protocolArray = new Array();
protocolArray["OAuth_v2.0"]="oauth20";
protocolArray["OAuth_v2.1"]="oauth20";
protocolArray["OpenID_Connect_v1.0"]="oauth20";
protocolArray["SAML_v2.0"]="saml20";
protocolArray["Token_Based"]="tokenbased";
protocolArray["Form_Based"]="formbased";

View File

@@ -4,6 +4,21 @@
<#include "../../layout/header.ftl"/>
<#include "../../layout/common.cssjs.ftl"/>
<#include "../appCommonHead.ftl"/>
<script type="text/javascript">
<!--
$(function(){
if("OAuth_v2.0"=="${model.protocol!}") {
$("#app_protocol_control").html(
'<select id="protocol" name="protocol" class="form-control form-select" >'+
'<option value="OAuth_v2.0" selected >OAuth_v2.0</option>'+
'<option value="OAuth_v2.1" >OAuth_v2.1</option>'+
'<option value="OpenID_Connect_v1.0" >OpenID_Connect_v1.0</option>'+
'</select>'
);
}
});
//-->
</script>
</head>
<body>
<form id="actionForm_app" method="post" type="label" autoclose="true" closeWindow="true"
@@ -94,6 +109,27 @@
</td>
</tr>
<tr>
<th>PKCE</th>
<td >
<select id="pkce" name="pkce" class="form-control form-select">
<option value="yes" >
<@locale code="common.text.yes" /></option>
<option value="no" selected>
<@locale code="common.text.no" /></option>
</select>
</td>
<th><@locale code="apps.oauth.approvalPrompt" /></th>
<td >
<select id="approvalPrompt" name="approvalPrompt" class="form-control form-select" >
<option value="force" selected>
<@locale code="apps.oauth.approvalPrompt.force" /></option>
<option value="auto" >
<@locale code="apps.oauth.approvalPrompt.auto" /></option>
</select>
</td>
</tr>
<tr>
<td colspan=4><@locale code="apps.oauth.connect.info" /></td>
</tr>
<tr>
@@ -189,20 +225,7 @@
</select>
</td>
</tr>
<tr>
<th><@locale code="apps.oauth.approvalPrompt" /></th>
<td >
<select id="approvalPrompt" name="approvalPrompt" class="form-control form-select" >
<option value="force" selected>
<@locale code="apps.oauth.approvalPrompt.force" /></option>
<option value="auto" >
<@locale code="apps.oauth.approvalPrompt.auto" /></option>
</select>
</td>
<th></th>
<td >
</td>
</tr>
<tr>
<td colspan =4>
<input id="status" type="hidden" name="status" value="1"/>

View File

@@ -55,7 +55,7 @@
<td>phone<input type="checkbox" id="scope_phone" name="scope" value="phone" <#if model.scope?contains('phone') >checked</#if>/></td>
<td>address<input type="checkbox" id="scope_address" name="scope" value="address" <#if model.scope?contains('address') >checked</#if>/></td>
<td>all<input type="checkbox" id="scope_all" name="scope" value="all" <#if model.scope?contains('all') >checked</#if>/></td>
<td><b class="orange">*</b><label for="scope"></label></td>
<td><b class="orange"></b><label for="scope"></label></td>
</tr>
</table>
</td>
@@ -96,6 +96,26 @@
</td>
</tr>
<tr>
<th>PKCE</th>
<td >
<select id="pkce" name="pkce" class="form-control form-select">
<option value="yes" <#if "yes"==model.pkce?default("yes") >selected</#if>>
<@locale code="common.text.yes" /></option>
<option value="no" <#if 'no'==model.pkce >selected</#if>>
<@locale code="common.text.no" /></option>
</select>
</td>
<th><@locale code="apps.oauth.approvalPrompt" /></th>
<td >
<select id="approvalPrompt" name="approvalPrompt" class="form-control form-select">
<option value="force" <#if ""==model.approvalPrompt?default("") >selected</#if>>
<@locale code="apps.oauth.approvalPrompt.force" /></option>
<option value="auto" <#if 'auto'==model.approvalPrompt >selected</#if>>
<@locale code="apps.oauth.approvalPrompt.auto" /></option>
</select>
</td>
</tr>
<tr>
<th><@locale code="apps.oauth.connect.idTokenSigningAlgorithm" /></th>
<td >
<select id="idTokenSigningAlgorithm" name="idTokenSigningAlgorithm" class="form-control form-select">
@@ -188,21 +208,7 @@
</select>
</td>
</tr>
<tr>
<th><@locale code="apps.oauth.approvalPrompt" /></th>
<td >
<select id="approvalPrompt" name="approvalPrompt" class="form-control form-select">
<option value="force" <#if ""==model.approvalPrompt?default("") >selected</#if>>
<@locale code="apps.oauth.approvalPrompt.force" /></option>
<option value="auto" <#if 'auto'==model.approvalPrompt >selected</#if>>
<@locale code="apps.oauth.approvalPrompt.auto" /></option>
</select>
</td>
<th></th>
<td >
</td>
</tr>
</tbody>
</table>
</td>