response types

pull/306/merge
Justin Richer 2013-03-05 14:29:51 -05:00
parent 82ecef144d
commit 23bd6a2ffb
2 changed files with 59 additions and 17 deletions

View File

@ -290,12 +290,23 @@ var ClientFormView = Backbone.View.extend({
// maps from a form-friendly name to the real grant parameter name
grantMap:{
"authorization_code": "authorization_code",
"password": "password",
"implicit": "implicit",
"client_credentials": "client_credentials",
"redelegate": "urn:ietf:params:oauth:grant_type:redelegate",
"refresh_token": "refresh_token"
'authorization_code': 'authorization_code',
'password': 'password',
'implicit': 'implicit',
'client_credentials': 'client_credentials',
'redelegate': 'urn:ietf:params:oauth:grant_type:redelegate',
'refresh_token': 'refresh_token'
},
// maps from a form-friendly name to the real reponse type parameter name
repsonseMap:{
'code': 'code',
'token': 'token',
'idtoken': 'id_token',
'token-idtoken': 'token id_token',
'code-idtoken': 'code id_token',
'code-token': 'code token',
'code-token-idtoken': 'code token id_token'
},
saveClient:function (event) {
@ -312,6 +323,14 @@ var ClientFormView = Backbone.View.extend({
grantTypes.push(type);
}
});
// build the response type object
var responseTypes = [];
$.each(this.responseMap, function(index,type) {
if ($('#responseTypes-' + index).is(':checked')) {
responseTypes.push(type);
}
});
var requireClientSecret = $('#requireClientSecret input').is(':checked');
var generateClientSecret = $('#generateClientSecret input').is(':checked');
@ -373,13 +392,13 @@ var ClientFormView = Backbone.View.extend({
jwksUri: $('#jwksUri input').val(),
subjectType: $('#applicationType input').filter(':checked').val(),
tokenEndpointAuthMethod: $('#tokenEndpointAuthMethod input').filter(':checked').val(),
responseTypes: responseTypes,
// TODO: everything below this line isn't implemented yet
/*
contacts: this.contactsCollection.pluck('item'),
responseTypes: responseTypes, // TODO: need a preprocessor?
sectorIdentifierUri: $('#sectorIdentifierUri input').val(),
requestObjectSigningAlg: requestObjectSigningAlg, // TODO: need a preprocessor for all the JOSE stuff:
userInfoEncryptedResponseAlg: userInfoEncryptedResponseAlg, // "

View File

@ -190,31 +190,54 @@
</label>
<label class="checkbox">
<input id="grantTypes-client_credentials" type="checkbox"
<%=($.inArray("client_credentials", grantTypes) > -1 ? 'checked' : '')%>> client
credentials
<%=($.inArray("client_credentials", grantTypes) > -1 ? 'checked' : '')%>> client credentials
</label>
<label class="checkbox">
<input id="grantTypes-password" type="checkbox" <%=($.inArray("password",
grantTypes) > -1 ? 'checked' : '')%>> password
<input id="grantTypes-password" type="checkbox" <%=($.inArray("password", grantTypes) > -1 ? 'checked' : '')%>> password
</label>
<label class="checkbox">
<input id="grantTypes-implicit" type="checkbox" <%=($.inArray("implicit",
grantTypes) > -1 ? 'checked' : '')%>> implicit
<input id="grantTypes-implicit" type="checkbox" <%=($.inArray("implicit", grantTypes) > -1 ? 'checked' : '')%>> implicit
</label>
<!--
<label class="checkbox">
<input id="grantTypes-refresh_token" type="checkbox" <%=($.inArray("refresh_token",
grantTypes) > -1 ? 'checked' : '')%>> refresh
<input id="grantTypes-refresh_token" type="checkbox" <%=($.inArray("refresh_token", grantTypes) > -1 ? 'checked' : '')%>> refresh
</label>
-->
<label class="checkbox">
<input id="grantTypes-redelegate" type="checkbox" <%=($.inArray("urn:ietf:params:oauth:grant_type:redelegate",
grantTypes) > -1 ? 'checked' : '')%>> redelegate
<input id="grantTypes-redelegate" type="checkbox" <%=($.inArray("urn:ietf:params:oauth:grant_type:redelegate", grantTypes) > -1 ? 'checked' : '')%>> redelegate
</label>
</div>
</div>
<div class="control-group" id="responseTypes">
<label class="control-label">Response Types</label>
<div class="controls">
<label class="checkbox">
<input id="responseTypes-code" type="checkbox" <%=($.inArray("code", responseTypes) > -1 ? 'checked' : '')%>> code
</label>
<label class="checkbox">
<input id="responseTypes-token" type="checkbox" <%=($.inArray("token", responseTypes) > -1 ? 'checked' : '')%>> token
</label>
<label class="checkbox">
<input id="responseTypes-idtoken" type="checkbox" <%=($.inArray("id_token", responseTypes) > -1 ? 'checked' : '')%>> id_token
</label>
<label class="checkbox">
<input id="responseTypes-token-idtoken" type="checkbox" <%=($.inArray("token id_token", responseTypes) > -1 ? 'checked' : '')%>> token id_token
</label>
<label class="checkbox">
<input id="responseTypes-code-idtoken" type="checkbox" <%=($.inArray("code id_token", responseTypes) > -1 ? 'checked' : '')%>> code id_token
</label>
<label class="checkbox">
<input id="responseTypes-code-token" type="checkbox" <%=($.inArray("code token", responseTypes) > -1 ? 'checked' : '')%>> code token
</label>
<label class="checkbox">
<input id="responseTypes-code-token-idtoken" type="checkbox" <%=($.inArray("code token id_token", responseTypes) > -1 ? 'checked' : '')%>> code token id_token
</label>
</div>
</div>
<div class="control-group" id="allowIntrospection">
<label class="control-label">Introspection</label>
<div class="controls">