registerClient.jsp revision f58c87ece2202b8f85310d8885c7e39a7f435c09
c285785ffc9f35513e0c6e7e2a05df3090dc919cvboxsync<html>
c285785ffc9f35513e0c6e7e2a05df3090dc919cvboxsync<head>
c285785ffc9f35513e0c6e7e2a05df3090dc919cvboxsync <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
c285785ffc9f35513e0c6e7e2a05df3090dc919cvboxsync <title>Client Registration</title>
c285785ffc9f35513e0c6e7e2a05df3090dc919cvboxsync <script src="/js/jquery.js"></script>
c285785ffc9f35513e0c6e7e2a05df3090dc919cvboxsync <script>
c7814cf6e1240a519cbec0441e033d0e2470ed00vboxsync $(document).ready(function () {
c285785ffc9f35513e0c6e7e2a05df3090dc919cvboxsync //add buttons
c285785ffc9f35513e0c6e7e2a05df3090dc919cvboxsync $('#add_url').click(function(){
c285785ffc9f35513e0c6e7e2a05df3090dc919cvboxsync console.log("add_url Pressed");
c285785ffc9f35513e0c6e7e2a05df3090dc919cvboxsync var options = $('#redirection_urls').prop('options');
c285785ffc9f35513e0c6e7e2a05df3090dc919cvboxsync var value = $('#url').val();
c285785ffc9f35513e0c6e7e2a05df3090dc919cvboxsync options[options.length] = new Option(value, value, false, false);
c285785ffc9f35513e0c6e7e2a05df3090dc919cvboxsync });
c285785ffc9f35513e0c6e7e2a05df3090dc919cvboxsync $('#add_scope').click(function(){
c285785ffc9f35513e0c6e7e2a05df3090dc919cvboxsync console.log("add_scope Pressed");
c285785ffc9f35513e0c6e7e2a05df3090dc919cvboxsync var options = $('#scopes').prop('options');
c285785ffc9f35513e0c6e7e2a05df3090dc919cvboxsync var value = $('#scope').val();
c285785ffc9f35513e0c6e7e2a05df3090dc919cvboxsync options[options.length] = new Option(value, value, false, false);
c285785ffc9f35513e0c6e7e2a05df3090dc919cvboxsync });
c285785ffc9f35513e0c6e7e2a05df3090dc919cvboxsync $('#add_default_scope').click(function(){
c285785ffc9f35513e0c6e7e2a05df3090dc919cvboxsync console.log("add_default_scope Pressed");
c285785ffc9f35513e0c6e7e2a05df3090dc919cvboxsync var options = $('#default_scopes').prop('options');
c285785ffc9f35513e0c6e7e2a05df3090dc919cvboxsync var value = $('#default_scope').val();
c285785ffc9f35513e0c6e7e2a05df3090dc919cvboxsync options[options.length] = new Option(value, value, false, false);
a5d214fbec758376bb145deec768ab9ac838dedevboxsync });
a5d214fbec758376bb145deec768ab9ac838dedevboxsync $('#add_display_name').click(function(){
9049443f8646745dee68ea8af618a2a4a59e2c0cvboxsync console.log("add_display_name Pressed");
37c19462742053e3eadb212a9bb5a3d59b7b1878vboxsync var options = $('#display_names').prop('options');
a5d214fbec758376bb145deec768ab9ac838dedevboxsync var value = $('#display_name').val();
a5d214fbec758376bb145deec768ab9ac838dedevboxsync options[options.length] = new Option(value, value, false, false);
a5d214fbec758376bb145deec768ab9ac838dedevboxsync });
55fe99386d1cc8178f1a8a0c74e3f501a09c3f23vboxsync $('#add_dispaly_description').click(function(){
a5d214fbec758376bb145deec768ab9ac838dedevboxsync console.log("add_dispaly_description Pressed");
a5d214fbec758376bb145deec768ab9ac838dedevboxsync var options = $('#display_descriptions').prop('options');
a5d214fbec758376bb145deec768ab9ac838dedevboxsync var value = $('#display_description').val();
a5d214fbec758376bb145deec768ab9ac838dedevboxsync options[options.length] = new Option(value, value, false, false);
c285785ffc9f35513e0c6e7e2a05df3090dc919cvboxsync });
f73c68fe41a3db55167b7266efd6955e5dbd0b47vboxsync
f73c68fe41a3db55167b7266efd6955e5dbd0b47vboxsync //remove buttons
f73c68fe41a3db55167b7266efd6955e5dbd0b47vboxsync $('#remove_url').click(function(){
f73c68fe41a3db55167b7266efd6955e5dbd0b47vboxsync console.log("remove_url Pressed");
a0a39b1e5c38b17c62e1fe70e6ab455e3cda7063vboxsync $('#redirection_urls option:selected').remove();
f73c68fe41a3db55167b7266efd6955e5dbd0b47vboxsync });
f73c68fe41a3db55167b7266efd6955e5dbd0b47vboxsync $('#remove_scope').click(function(){
b0a3d0ec5780199a2f379da63c59ccf48f1a73b9vboxsync console.log("remove_scope Pressed");
37c19462742053e3eadb212a9bb5a3d59b7b1878vboxsync $('#scopes option:selected').remove();
37c19462742053e3eadb212a9bb5a3d59b7b1878vboxsync });
37c19462742053e3eadb212a9bb5a3d59b7b1878vboxsync $('#remove_default_scope').click(function(){
37c19462742053e3eadb212a9bb5a3d59b7b1878vboxsync console.log("remove_default_scope Pressed");
37c19462742053e3eadb212a9bb5a3d59b7b1878vboxsync $('default_scopes option:selected').remove();
37c19462742053e3eadb212a9bb5a3d59b7b1878vboxsync });
37c19462742053e3eadb212a9bb5a3d59b7b1878vboxsync $('#remove_display_name').click(function(){
37c19462742053e3eadb212a9bb5a3d59b7b1878vboxsync console.log("remove_display_name Pressed");
37c19462742053e3eadb212a9bb5a3d59b7b1878vboxsync $('display_names option:selected').remove();
37c19462742053e3eadb212a9bb5a3d59b7b1878vboxsync });
f73c68fe41a3db55167b7266efd6955e5dbd0b47vboxsync $('#remove_display_description').click(function(){
f73c68fe41a3db55167b7266efd6955e5dbd0b47vboxsync console.log("remove_display_description Pressed");
f73c68fe41a3db55167b7266efd6955e5dbd0b47vboxsync $('#display_descriptions option:selected').remove();
89fcb45a9b123043e94c06d32799c2a7fcc2af7dvboxsync });
f73c68fe41a3db55167b7266efd6955e5dbd0b47vboxsync
f73c68fe41a3db55167b7266efd6955e5dbd0b47vboxsync //form submit
f73c68fe41a3db55167b7266efd6955e5dbd0b47vboxsync $('#client').submit(function(){
f73c68fe41a3db55167b7266efd6955e5dbd0b47vboxsync console.log("client submit");
f73c68fe41a3db55167b7266efd6955e5dbd0b47vboxsync var password1 = $('#client_password').val();
f73c68fe41a3db55167b7266efd6955e5dbd0b47vboxsync var password2 = $('#client_password2').val();
80559ecb51cb45f6869d8450a1317ead0dd5129dvboxsync //password not the same
80559ecb51cb45f6869d8450a1317ead0dd5129dvboxsync if (password1 != password2){
80559ecb51cb45f6869d8450a1317ead0dd5129dvboxsync $('#message').html("<b>Client password must be the same.<b><br><br>");
80559ecb51cb45f6869d8450a1317ead0dd5129dvboxsync return false;
f73c68fe41a3db55167b7266efd6955e5dbd0b47vboxsync }
f73c68fe41a3db55167b7266efd6955e5dbd0b47vboxsync
f73c68fe41a3db55167b7266efd6955e5dbd0b47vboxsync //check for empty required values
f73c68fe41a3db55167b7266efd6955e5dbd0b47vboxsync var redirection_options = $('#redirection_urls').prop('options');
f73c68fe41a3db55167b7266efd6955e5dbd0b47vboxsync if (redirection_options.length <= 0){
f73c68fe41a3db55167b7266efd6955e5dbd0b47vboxsync $('#message').html("<b>Redirection URLS are required.<b><br><br>");
f73c68fe41a3db55167b7266efd6955e5dbd0b47vboxsync return false;
f73c68fe41a3db55167b7266efd6955e5dbd0b47vboxsync }
f73c68fe41a3db55167b7266efd6955e5dbd0b47vboxsync var scopes_options = $('#default_scopes').prop('options');
2c709acd5e2f434e71614aa89020bf8d0776a1e9vboxsync var default_scope_options = $('#default_scopes').prop('options');
2c709acd5e2f434e71614aa89020bf8d0776a1e9vboxsync if (default_scope_options.length <= 0){
9b309678c6cfa8f6c62b9dc985a0d745e7756de9vboxsync $('#message').html("<b>Default scopes are required.<b><br><br>");
2c709acd5e2f434e71614aa89020bf8d0776a1e9vboxsync return false;
80559ecb51cb45f6869d8450a1317ead0dd5129dvboxsync }
80559ecb51cb45f6869d8450a1317ead0dd5129dvboxsync var display_names_options = $('#display_names').prop('options');
80559ecb51cb45f6869d8450a1317ead0dd5129dvboxsync if (display_names_options.length <= 0){
80559ecb51cb45f6869d8450a1317ead0dd5129dvboxsync $('#message').html("<b>Display name are required.<b><br><br>");
2c709acd5e2f434e71614aa89020bf8d0776a1e9vboxsync return false;
f73c68fe41a3db55167b7266efd6955e5dbd0b47vboxsync }
f73c68fe41a3db55167b7266efd6955e5dbd0b47vboxsync var display_descriptions_options = $('#display_descriptions').prop('options');
1fff175c9a0fea173ee52a209224dc6ecbd39572vboxsync if (display_descriptions_options.length <= 0){
37c19462742053e3eadb212a9bb5a3d59b7b1878vboxsync $('#message').html("<b>Display descriptions are required.<b><br><br>");
37c19462742053e3eadb212a9bb5a3d59b7b1878vboxsync return false;
a0a39b1e5c38b17c62e1fe70e6ab455e3cda7063vboxsync }
37c19462742053e3eadb212a9bb5a3d59b7b1878vboxsync var client_id = $('#client_id');
2508d15edddcae0b79002fae3fe103d6c4836810vboxsync if (client_id.length <= 0){
a822858bf01e98b56ae4f8d0d80647eb849c4187vboxsync $('#message').html("<b>Client ID is required.<b><br><br>");
a822858bf01e98b56ae4f8d0d80647eb849c4187vboxsync return false;
f73c68fe41a3db55167b7266efd6955e5dbd0b47vboxsync }
f73c68fe41a3db55167b7266efd6955e5dbd0b47vboxsync var realm = $('#realm');
236251994d572b829ce98ce0c2cdeb5c571cfd11vboxsync if (realm.length <= 0){
d50b5e3e6c603275de6811050f6c304c5be7ae31vboxsync $('#message').html("<b>Realm is required.<b><br><br>");
236251994d572b829ce98ce0c2cdeb5c571cfd11vboxsync return false;
236251994d572b829ce98ce0c2cdeb5c571cfd11vboxsync }
a0a39b1e5c38b17c62e1fe70e6ab455e3cda7063vboxsync
236251994d572b829ce98ce0c2cdeb5c571cfd11vboxsync
236251994d572b829ce98ce0c2cdeb5c571cfd11vboxsync //get the selection options as a single string
236251994d572b829ce98ce0c2cdeb5c571cfd11vboxsync var temp = $('#redirection_urls_string');
236251994d572b829ce98ce0c2cdeb5c571cfd11vboxsync for (var i= 0; i < redirection_options.length; i++){
236251994d572b829ce98ce0c2cdeb5c571cfd11vboxsync temp.append(redirection_options[i].value+";");
236251994d572b829ce98ce0c2cdeb5c571cfd11vboxsync }
d50b5e3e6c603275de6811050f6c304c5be7ae31vboxsync
36e44a1ca13ffd4e286f0cd7e7d730c697e2fbebvboxsync var temp = $('#scopes_string');
236251994d572b829ce98ce0c2cdeb5c571cfd11vboxsync for (var i= 0; i < scopes_options.length; i++){
236251994d572b829ce98ce0c2cdeb5c571cfd11vboxsync temp.append(scopes_options[i].value+";");
d50b5e3e6c603275de6811050f6c304c5be7ae31vboxsync }
d50b5e3e6c603275de6811050f6c304c5be7ae31vboxsync var temp = $('#default_scopes_string');
a0a39b1e5c38b17c62e1fe70e6ab455e3cda7063vboxsync for (var i= 0; i < default_scope_options.length; i++){
236251994d572b829ce98ce0c2cdeb5c571cfd11vboxsync temp.append(default_scope_options[i].value+";");
f73c68fe41a3db55167b7266efd6955e5dbd0b47vboxsync }
f73c68fe41a3db55167b7266efd6955e5dbd0b47vboxsync var temp = $('#display_names_string');
f73c68fe41a3db55167b7266efd6955e5dbd0b47vboxsync for (var i= 0; i < display_names_options.length; i++){
f73c68fe41a3db55167b7266efd6955e5dbd0b47vboxsync temp.append(display_names_options[i].value+";");
f73c68fe41a3db55167b7266efd6955e5dbd0b47vboxsync }
f73c68fe41a3db55167b7266efd6955e5dbd0b47vboxsync var temp = $('#display_descriptions_string');
f73c68fe41a3db55167b7266efd6955e5dbd0b47vboxsync for (var i= 0; i < display_descriptions_options.length; i++){
f73c68fe41a3db55167b7266efd6955e5dbd0b47vboxsync temp.append(display_descriptions_options[i].value+";");
f73c68fe41a3db55167b7266efd6955e5dbd0b47vboxsync }
f73c68fe41a3db55167b7266efd6955e5dbd0b47vboxsync });
f73c68fe41a3db55167b7266efd6955e5dbd0b47vboxsync });
f73c68fe41a3db55167b7266efd6955e5dbd0b47vboxsync </script>
f73c68fe41a3db55167b7266efd6955e5dbd0b47vboxsync</head>
f73c68fe41a3db55167b7266efd6955e5dbd0b47vboxsync<body>
f73c68fe41a3db55167b7266efd6955e5dbd0b47vboxsync <h1>Register a Client</h1>
f73c68fe41a3db55167b7266efd6955e5dbd0b47vboxsync <form name="client" action="register_client" method="POST" id="client">
f73c68fe41a3db55167b7266efd6955e5dbd0b47vboxsync <div id="message"></div>
f73c68fe41a3db55167b7266efd6955e5dbd0b47vboxsync Realm:<br><input type="input" name="realm" value="" id="realm"/><br><br>
f73c68fe41a3db55167b7266efd6955e5dbd0b47vboxsync Client ID:<br><input type="input" name="client_id" value="" id="client_id"/><br><br>
f73c68fe41a3db55167b7266efd6955e5dbd0b47vboxsync Client Password:<br><input type="password" name="client_password" value="" id="client_password"/><br><br>
f73c68fe41a3db55167b7266efd6955e5dbd0b47vboxsync Client Password: (confirm)<br><input type="password" name="client_password2" value="" id="client_password2"/><br><br>
f73c68fe41a3db55167b7266efd6955e5dbd0b47vboxsync Client Type:<br><input type="radio" name="client_type" value="Confidential" checked />Confidential<br>
f73c68fe41a3db55167b7266efd6955e5dbd0b47vboxsync <input type="radio" name="client_type" value="Public"/>Public<br><br>
f73c68fe41a3db55167b7266efd6955e5dbd0b47vboxsync Redirection URL(s):<br><select id="redirection_urls" multiple="single" name="redirection_urls"></select><input type="button" name="remove_url" id="remove_url" value="Remove"/><br>
f73c68fe41a3db55167b7266efd6955e5dbd0b47vboxsync <input type="text" name="url" value="" id ="url"/><input type="button" name="add_url" id="add_url" value="Add"/><br><br>
2d3c9a4b29fcd6be8b49f5967c6e98553549b515vboxsync Scope(s):<br><select id="scopes" multiple="single" name="scopes"></select><input type="button" name="remove_scope" id="remove_scope" value="Remove"/><br>
3999272e44f3faa0f6bca415ff1a841fa1f887f6vboxsync <input type="text" name="scope" id ="scope" value=""/><input type="button" name="add_scope" id="add_scope" value="Add"/><br><br>
2d3c9a4b29fcd6be8b49f5967c6e98553549b515vboxsync Default Scope(s):<br><select id="default_scopes" multiple="single" name="default_scopes"></select><input type="button" name="remove_default_scope" id="remove_default_scope" value="Remove"/><br>
2d3c9a4b29fcd6be8b49f5967c6e98553549b515vboxsync <input type="text" name="default_scope" id ="default_scope" value=""/><input type="button" name="add_default_scope" id="add_default_scope" value="Add"/><br><br>
f73c68fe41a3db55167b7266efd6955e5dbd0b47vboxsync Display Name(s):<br><select id="display_names" multiple="single" name="display_names"></select><input type="button" name="remove_display_name" id="remove_display_name" value="Remove"/><br>
f73c68fe41a3db55167b7266efd6955e5dbd0b47vboxsync <input type="text" name="display_name" id ="display_name" value=""/><input type="button" name="add_display_name" id="add_display_name" value="Add"/><br><br>
f73c68fe41a3db55167b7266efd6955e5dbd0b47vboxsync Display Description(s):<br><select id="display_descriptions" multiple="single" name="display_descriptions"></select><input type="button" name="remove_display_description" id="remove_display_description" value="Remove"/><br>
f73c68fe41a3db55167b7266efd6955e5dbd0b47vboxsync <input type="text" name="display_description" id ="display_description" value=""/><input type="button" name="add_dispaly_description" id="add_dispaly_description" value="Add"/><br><br>
f73c68fe41a3db55167b7266efd6955e5dbd0b47vboxsync <!--
2508d15edddcae0b79002fae3fe103d6c4836810vboxsync Token Validation Type:<br><input type="radio" name="token_type" value="Bearer" checked />Bearer<br>
a0a39b1e5c38b17c62e1fe70e6ab455e3cda7063vboxsync <input type="radio" name="token_type" value="MAC"/>MAC<br>
236251994d572b829ce98ce0c2cdeb5c571cfd11vboxsync <input type="radio" name="token_type" value="SAML 2.0"/>SAML 2.0<br><br>
bcf9fab594306cd97251f7f03b8319a158c29ea5vboxsync -->
bcf9fab594306cd97251f7f03b8319a158c29ea5vboxsync <input type="Submit" name="save" id="submit"/>
89fcb45a9b123043e94c06d32799c2a7fcc2af7dvboxsync
1fff175c9a0fea173ee52a209224dc6ecbd39572vboxsync <!--used to transferdata -->
2c709acd5e2f434e71614aa89020bf8d0776a1e9vboxsync
2c709acd5e2f434e71614aa89020bf8d0776a1e9vboxsync <textarea hidden="true" name="redirection_urls" id="redirection_urls_string"></textarea>
2c709acd5e2f434e71614aa89020bf8d0776a1e9vboxsync <textarea hidden="true" name="scopes" id="scopes_string"></textarea>
2c709acd5e2f434e71614aa89020bf8d0776a1e9vboxsync <textarea hidden="true" name="default_scopes" id="default_scopes_string"></textarea>
2c709acd5e2f434e71614aa89020bf8d0776a1e9vboxsync <textarea hidden="true" name="display_names" id="display_names_string"></textarea>
464697bd4c58e78f3b3eecc1d51904482bae27f8vboxsync <textarea hidden="true" name="display_descriptions" id="display_descriptions_string"></textarea>
c97d00f4828608e3ac87e48fee3dfa8bc4437bf1vboxsync
c97d00f4828608e3ac87e48fee3dfa8bc4437bf1vboxsync </form>
c97d00f4828608e3ac87e48fee3dfa8bc4437bf1vboxsync</body>
c97d00f4828608e3ac87e48fee3dfa8bc4437bf1vboxsync