mirror of
https://github.com/documize/community.git
synced 2025-08-02 20:15:26 +02:00
PRovide LDAP sync and authentication
This commit is contained in:
parent
63b17f9b88
commit
074eea3aeb
38 changed files with 567 additions and 499 deletions
|
@ -32,7 +32,7 @@ export default Controller.extend(NotifierMixin, {
|
|||
});
|
||||
},
|
||||
|
||||
onSync() {
|
||||
onSyncKeycloak() {
|
||||
return new EmberPromise((resolve) => {
|
||||
this.get('global').syncKeycloak().then((response) => {
|
||||
resolve(response);
|
||||
|
@ -40,6 +40,14 @@ export default Controller.extend(NotifierMixin, {
|
|||
});
|
||||
},
|
||||
|
||||
onSyncLDAP() {
|
||||
return new EmberPromise((resolve) => {
|
||||
this.get('global').syncLDAP().then((response) => {
|
||||
resolve(response);
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
onChange(data) {
|
||||
this.get('session').logout();
|
||||
this.set('appMeta.authProvider', data.authProvider);
|
||||
|
|
|
@ -33,32 +33,7 @@ export default Route.extend(AuthenticatedRouteMixin, {
|
|||
authConfig: null,
|
||||
};
|
||||
|
||||
let config = {
|
||||
ServerType: constants.AuthProvider.ServerTypeLDAP,
|
||||
ServerHost: "127.0.0.1",
|
||||
ServerPort: 389,
|
||||
EncryptionType: constants.AuthProvider.EncryptionTypeStartTLS,
|
||||
BaseDN: "ou=people,dc=planetexpress,dc=com",
|
||||
BindDN: "cn=admin,dc=planetexpress,dc=com",
|
||||
BindPassword: "GoodNewsEveryone",
|
||||
UserFilter: "(|(objectClass=person)(objectClass=user)(objectClass=inetOrgPerson))",
|
||||
GroupFilter: "(&(objectClass=group)(|(cn=ship_crew)(cn=admin_staff)))",
|
||||
AttributeUserRDN: "uid",
|
||||
AttributeUserFirstname: "givenName",
|
||||
AttributeUserLastname: "sn",
|
||||
AttributeUserEmail: "mail",
|
||||
AttributeUserDisplayName: "",
|
||||
AttributeUserGroupName: "",
|
||||
AttributeGroupMember: "member",
|
||||
};
|
||||
|
||||
this.get('global').previewLDAP(config).then((r) => {
|
||||
console.log(r);
|
||||
});
|
||||
|
||||
return new EmberPromise((resolve) => {
|
||||
let constants = this.get('constants');
|
||||
|
||||
this.get('global').getAuthConfig().then((config) => {
|
||||
switch (data.authProvider) {
|
||||
case constants.AuthProvider.Keycloak:
|
||||
|
|
|
@ -1,2 +1,7 @@
|
|||
{{customize/auth-settings authProvider=model.authProvider authConfig=model.authConfig
|
||||
onSave=(action 'onSave') onSync=(action 'onSync') onChange=(action 'onChange')}}
|
||||
{{customize/auth-settings
|
||||
authProvider=model.authProvider
|
||||
authConfig=model.authConfig
|
||||
onSave=(action 'onSave')
|
||||
onSyncLDAP=(action 'onSyncLDAP')
|
||||
onSyncKeycloak=(action 'onSyncKeycloak')
|
||||
onChange=(action 'onChange')}}
|
||||
|
|
|
@ -57,12 +57,20 @@ export default Controller.extend({
|
|||
this.loadUsers(filter);
|
||||
},
|
||||
|
||||
onSync() {
|
||||
onSyncKeycloak() {
|
||||
this.set('syncInProgress', true);
|
||||
this.get('globalSvc').syncKeycloak().then(() => {
|
||||
this.set('syncInProgress', false);
|
||||
this.loadUsers('');
|
||||
});
|
||||
},
|
||||
|
||||
onSyncLDAP() {
|
||||
this.set('syncInProgress', true);
|
||||
this.get('globalSvc').syncLDAP().then(() => {
|
||||
this.set('syncInProgress', false);
|
||||
this.loadUsers('');
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
|
@ -5,7 +5,8 @@
|
|||
{{customize/user-list users=model
|
||||
syncInProgress=syncInProgress
|
||||
userLimit=userLimit
|
||||
onSync=(action "onSync")
|
||||
onSyncKeycloak=(action "onSyncKeycloak")
|
||||
onSyncLDAP=(action "onSyncLDAP")
|
||||
onFilter=(action "onFilter")
|
||||
onDelete=(action "onDelete")
|
||||
onSave=(action "onSave")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue