Commit 61f82361 authored by Thomas Chemineau's avatar Thomas Chemineau
Browse files

now able to store SAML metadata in configuration

parent a1976436
......@@ -157,6 +157,32 @@ function setlmtext(id,v){
function setlmdata(id,v){
$('#text_'+id).attr('value',v);
}
function setlmsaml(id,div,v){
var max=0;
if(div=='samlAssertion'){
max=1;
}
var s='';
var t=$('#content_'+div).find('input').get();
for(i in t){
if(i > max){
s=s+';';
}
var k=$(t[i]).attr('id');
if(k=='samlAssertionDefaultOn'){
if($(t[i]).attr('checked')==true){
s=s+'1';
}
}else if(k=='samlAssertionDefaultOff'){
if($(t[i]).attr('checked')==true){
s=s+'0';
}
}else{
s=s+$(t[i]).attr('value');
}
}
setlmdata(id,s);
}
function display(div,title) {
var divs=$('#content').children();
divs.toggleClass('hidden',true);
......@@ -209,17 +235,24 @@ function textarea(id) {
}
function samlAssertion(id) {
currentId=id;
$('#samlAssertionDefault').attr('value',lmdata(id));
$('#samlAssertionIndex').attr('value',lmdata(id));
$('#samlAssertionLocation').attr('value',lmdata(id));
display('samlAssertion',lmtext(lmparent(id)));
var t=lmdata(id).split(';');
if(t[0]==1){
$('#samlAssertionDefaultOn').attr('checked',true);
}else{
$('#samlAssertionDefaultOff').attr('checked',true);
}
$('#samlAssertionIndex').attr('value',t[1]);
$('#samlAssertionBinding').attr('value',t[2]);
$('#samlAssertionLocation').attr('value',t[3]);
display('samlAssertion',lmtext(id));
}
function samlService(id) {
currentId=id;
$('#samlServiceBinding').attr('value',lmdata(id));
$('#samlServiceLocation').attr('value',lmdata(id));
$('#samlServiceResponseLocation').attr('value',lmdata(id));
display('samlService',lmtext(lmparent(id)));
var t=lmdata(id).split(';');
$('#samlServiceBinding').attr('value',t[0]);
$('#samlServiceLocation').attr('value',t[1]);
$('#samlServiceResponseLocation').attr('value',t[2]);
display('samlService',lmtext(id));
}
function securedCookieValues(id){
currentId=id;
......
......@@ -184,15 +184,15 @@
<table>
<tr>
<td><lang en="Binding" fr="Binding"/></td>
<td><input type="text" size="50" id="samlServiceBinding" onchange="setlmtext(currentId,this.value)"/></td>
<td><input type="text" size="50" id="samlServiceBinding" onchange="setlmsaml(currentId,'samlService',this.value)"/></td>
</tr>
<tr>
<td><lang en="Location" fr="URL"/></td>
<td><input type="text" size="50" id="samlServiceLocation" onchange="setlmtext(currentId,this.value)"/></td>
<td><input type="text" size="50" id="samlServiceLocation" onchange="setlmsaml(currentId,'samlService',this.value)"/></td>
</tr>
<tr>
<td><lang en="Response Location" fr="URL de retour"/></td>
<td><input type="text" size="50" id="samlServiceResponseLocation" onchange="setlmtext(currentId,$this.value)"/></td>
<td><input type="text" size="50" id="samlServiceResponseLocation" onchange="setlmsaml(currentId,'samlService',this.value)"/></td>
</tr>
</table>
</div>
......@@ -202,17 +202,21 @@
<table>
<tr>
<td><lang en="Default" fr="Par défaut"/></td>
<td><input id="samlAssertionDefaultOn" type="radio" name="boolean" value="1" onclick="setlmdata(currentId,1)"/> <lang en="On" fr="Activé"/>
<input id="samlAssertionDefaultOff" type="radio" name="boolean" value="0" onclick="setlmdata(currentId,0)"/> <lang en="Off" fr="Désactivé"/>
<td><input id="samlAssertionDefaultOn" type="radio" name="boolean" value="1" onclick="setlmsaml(currentId,'samlAssertion',1)"/> <lang en="On" fr="Activé"/>
<input id="samlAssertionDefaultOff" type="radio" name="boolean" value="0" onclick="setlmsaml(currentId,'samlAssertion',0)"/> <lang en="Off" fr="Désactivé"/>
</td>
</tr>
<tr>
<td><lang en="Index" fr="Index"/></td>
<td><input type="text" size="50" id="samlAssertionIndex" onchange="setlmtext(currentId,this.value)"/></td>
<td><input type="text" size="50" id="samlAssertionIndex" onchange="setlmsaml(currentId,'samlAssertion',this.value)"/></td>
</tr>
<tr>
<td><lang en="Binding" fr="Binding"/></td>
<td><input type="text" size="50" id="samlAssertionBinding" onchange="setlmsaml(currentId,'samlAssertion',this.value)"/></td>
</tr>
<tr>
<td><lang en="Location" fr="URL"/></td>
<td><input type="text" size="50" id="samlAssertionLocation" onchange="setlmtext(currentId,$this.value)"/></td>
<td><input type="text" size="50" id="samlAssertionLocation" onchange="setlmsaml(currentId,'samlAssertion',this.value)"/></td>
</tr>
</table>
</div>
......
......@@ -574,22 +574,49 @@ sub defaultConf {
samlSPSSODescriptorProtocolSupportEnumeration =>
'urn:oasis:names:tc:SAML:2.0:protocol',
samlSPSSODescriptorKeyDescriptorSigning => '',
samlSPSSODescriptorSingleLogoutServiceHTTP => '',
samlSPSSODescriptorSingleLogoutServiceSOAP => '',
samlSPSSODescriptorAssertionConsumerServiceHTTPArtifact => '',
samlSPSSODescriptorAssertionConsumerServiceHTTPPost => '',
samlSPSSODescriptorAssertionConsumerServiceHTTPRedirect => '',
samlSPSSODescriptorSingleLogoutServiceHTTP =>
'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect;'
.'http://auth.example.com/saml/proxySingleLogout;'
.'http://auth.example.com/saml/proxySingleLogoutReturn',
samlSPSSODescriptorSingleLogoutServiceSOAP =>
'urn:oasis:names:tc:SAML:2.0:bindings:SOAP;'
.'http://auth.example.com/saml/proxySingleLogoutSOAP;',
samlSPSSODescriptorAssertionConsumerServiceHTTPArtifact =>
'1;0;urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Artifact;'
.'http://auth.example.com/saml/proxySingleSignOnArtifact',
samlSPSSODescriptorAssertionConsumerServiceHTTPPost =>
'0;1;urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST;'
.'http://auth.example.com/saml/proxySingleSignOnPost',
samlSPSSODescriptorAssertionConsumerServiceHTTPRedirect =>
'0;2;urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect;'
.'http://auth.example.com/saml/proxySingleSignOnRedirect',
samlIDPSSODescriptorWantAuthnRequestsSigned => '0',
samlIDPSSODescriptorProtocolSupportEnumeration =>
'urn:oasis:names:tc:SAML:2.0:protocol',
samlIDPSSODescriptorKeyDescriptorSigning => '',
samlIDPSSODescriptorSingleSignOnServiceHTTP => '',
samlIDPSSODescriptorSingleSignOnServiceSOAP => '',
samlIDPSSODescriptorSingleLogoutServiceHTTP => '',
samlIDPSSODescriptorSingleLogoutServiceSOAP => '',
samlIDPSSODescriptorArtifactResolutionServiceArtifact => '',
samlIDPSSODescriptorManageNameIDServiceHTTP => '',
samlIDPSSODescriptorManageNameIDServiceSOAP => '',
samlIDPSSODescriptorSingleSignOnServiceHTTP =>
'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect;'
.'http://auth.example.com/saml/singleSignOn;',
samlIDPSSODescriptorSingleSignOnServiceSOAP =>
'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-SOAP;'
.'http://auth.example.com/saml/singleSignOnSOAP;',
samlIDPSSODescriptorSingleLogoutServiceHTTP =>
'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect;'
.'http://auth.example.com/saml/singleLogout;'
.'http://auth.example.com/saml/singleLogoutReturn',
samlIDPSSODescriptorSingleLogoutServiceSOAP =>
'urn:oasis:names:tc:SAML:2.0:bindings:SOAP;'
.'http://auth.example.com/saml/singleLogoutSOAP;',
samlIDPSSODescriptorArtifactResolutionServiceArtifact =>
'1;0;urn:oasis:names:tc:SAML:2.0:bindings:SOAP;'
.'http://auth.example.com/saml/artifact',
samlIDPSSODescriptorManageNameIDServiceHTTP =>
'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect;'
.'http://auth.example.com/saml/manageNameId;'
.'http://auth.example.com/saml/manageNameIdReturn',
samlIDPSSODescriptorManageNameIDServiceSOAP =>
'urn:oasis:names:tc:SAML:2.0:bindings:SOAP;'
.'http://auth.example.com/saml/manageNameIdSOAP;',
};
}
......
......@@ -137,9 +137,7 @@ sub en {
samlSPSSODescriptorAuthnRequestsSigned =>
'Signed Authentication Request',
samlSPSSODescriptorProtocolSupportEnumeration => 'Protocol',
samlSPSSODescriptorKeyDescriptor => 'Keys',
samlSPSSODescriptorKeyDescriptorSigning => 'Signing Key',
samlSPSSODescriptorKeyDescriptorEncryption => 'Encryption Key',
samlSPSSODescriptorSingleLogoutService => 'Single Logout',
samlSPSSODescriptorSingleLogoutServiceHTTP => 'HTTP Service',
samlSPSSODescriptorSingleLogoutServiceSOAP => 'SOAP Service',
......@@ -263,9 +261,7 @@ sub fr {
samlSPSSODescriptorAuthnRequestsSigned =>
'Requête d\'authentification signé',
samlSPSSODescriptorProtocolSupportEnumeration => 'Protocole',
samlSPSSODescriptorKeyDescriptor => 'Clefs',
samlSPSSODescriptorKeyDescriptorSigning => 'Clef de signature',
samlSPSSODescriptorKeyDescriptorEncryption => 'Clef de chiffrement',
samlSPSSODescriptorSingleLogoutService => 'Single Logout',
samlSPSSODescriptorSingleLogoutServiceHTTP => 'Service HTTP',
samlSPSSODescriptorSingleLogoutServiceSOAP => 'Service SOAP',
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment