default new client in UI to HEART-compliant values
parent
d75bba218d
commit
26d507d635
|
@ -479,28 +479,47 @@ var AppRouter = Backbone.Router.extend({
|
||||||
|
|
||||||
var view = new ClientFormView({model:client, systemScopeList: this.systemScopeList});
|
var view = new ClientFormView({model:client, systemScopeList: this.systemScopeList});
|
||||||
view.load(function() {
|
view.load(function() {
|
||||||
// set up this new client to require a secret and have us autogenerate one
|
|
||||||
var userInfo = getUserInfo();
|
var userInfo = getUserInfo();
|
||||||
var contacts = [];
|
var contacts = [];
|
||||||
if (userInfo != null && userInfo.email != null) {
|
if (userInfo != null && userInfo.email != null) {
|
||||||
contacts.push(userInfo.email);
|
contacts.push(userInfo.email);
|
||||||
}
|
}
|
||||||
|
|
||||||
client.set({
|
// use a different set of defaults based on heart mode flag
|
||||||
tokenEndpointAuthMethod: "SECRET_BASIC",
|
if (heartMode) {
|
||||||
generateClientSecret:true,
|
client.set({
|
||||||
displayClientSecret:false,
|
tokenEndpointAuthMethod: "PRIVATE_KEY",
|
||||||
requireAuthTime:true,
|
generateClientSecret:false,
|
||||||
defaultMaxAge:60000,
|
displayClientSecret:false,
|
||||||
scope: _.uniq(_.flatten(app.systemScopeList.defaultScopes().pluck("value"))),
|
requireAuthTime:true,
|
||||||
accessTokenValiditySeconds:3600,
|
defaultMaxAge:60000,
|
||||||
idTokenValiditySeconds:600,
|
scope: _.uniq(_.flatten(app.systemScopeList.defaultScopes().pluck("value"))),
|
||||||
grantTypes: ["authorization_code"],
|
accessTokenValiditySeconds:3600,
|
||||||
responseTypes: ["code"],
|
idTokenValiditySeconds:600,
|
||||||
subjectType: "PUBLIC",
|
grantTypes: ["authorization_code"],
|
||||||
jwksType: "URI",
|
responseTypes: ["code"],
|
||||||
contacts: contacts
|
subjectType: "PUBLIC",
|
||||||
}, { silent: true });
|
jwksType: "URI",
|
||||||
|
contacts: contacts
|
||||||
|
}, { silent: true });
|
||||||
|
} else {
|
||||||
|
// set up this new client to require a secret and have us autogenerate one
|
||||||
|
client.set({
|
||||||
|
tokenEndpointAuthMethod: "SECRET_BASIC",
|
||||||
|
generateClientSecret:true,
|
||||||
|
displayClientSecret:false,
|
||||||
|
requireAuthTime:true,
|
||||||
|
defaultMaxAge:60000,
|
||||||
|
scope: _.uniq(_.flatten(app.systemScopeList.defaultScopes().pluck("value"))),
|
||||||
|
accessTokenValiditySeconds:3600,
|
||||||
|
idTokenValiditySeconds:600,
|
||||||
|
grantTypes: ["authorization_code"],
|
||||||
|
responseTypes: ["code"],
|
||||||
|
subjectType: "PUBLIC",
|
||||||
|
jwksType: "URI",
|
||||||
|
contacts: contacts
|
||||||
|
}, { silent: true });
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
$('#content').html(view.render().el);
|
$('#content').html(view.render().el);
|
||||||
|
@ -853,16 +872,29 @@ var AppRouter = Backbone.Router.extend({
|
||||||
contacts.push(userInfo.email);
|
contacts.push(userInfo.email);
|
||||||
}
|
}
|
||||||
|
|
||||||
client.set({
|
if (heartMode) {
|
||||||
require_auth_time:true,
|
client.set({
|
||||||
default_max_age:60000,
|
require_auth_time:true,
|
||||||
scope: _.uniq(_.flatten(app.systemScopeList.defaultUnrestrictedScopes().pluck("value"))).join(" "),
|
default_max_age:60000,
|
||||||
token_endpoint_auth_method: 'client_secret_basic',
|
scope: _.uniq(_.flatten(app.systemScopeList.defaultUnrestrictedScopes().pluck("value"))).join(" "),
|
||||||
grant_types: ["authorization_code"],
|
token_endpoint_auth_method: 'private_key_jwt',
|
||||||
response_types: ["code"],
|
grant_types: ["authorization_code"],
|
||||||
subject_type: "public",
|
response_types: ["code"],
|
||||||
contacts: contacts
|
subject_type: "public",
|
||||||
}, { silent: true });
|
contacts: contacts
|
||||||
|
}, { silent: true });
|
||||||
|
} else {
|
||||||
|
client.set({
|
||||||
|
require_auth_time:true,
|
||||||
|
default_max_age:60000,
|
||||||
|
scope: _.uniq(_.flatten(app.systemScopeList.defaultUnrestrictedScopes().pluck("value"))).join(" "),
|
||||||
|
token_endpoint_auth_method: 'client_secret_basic',
|
||||||
|
grant_types: ["authorization_code"],
|
||||||
|
response_types: ["code"],
|
||||||
|
subject_type: "public",
|
||||||
|
contacts: contacts
|
||||||
|
}, { silent: true });
|
||||||
|
}
|
||||||
|
|
||||||
$('#content').html(view.render().el);
|
$('#content').html(view.render().el);
|
||||||
view.delegateEvents();
|
view.delegateEvents();
|
||||||
|
|
Loading…
Reference in New Issue