Skip to content

Commit

Permalink
LDAP auth provider (#9074)
Browse files Browse the repository at this point in the history
* Added LDAP implementation

* Cleanup and added refresh checking

* Added provider check to ldap

* Added LDAP docs

* Always update LDAP user role on authentication

* Fetched package-json from github

* Fixed lint error

* Update api/src/auth/drivers/ldap.ts

* Update api/src/auth/drivers/ldap.ts

* Added missing locale key

* Update docs/guides/api-config.md

* Update docs/configuration/config-options.md

* Update api/src/auth/drivers/ldap.ts

* Added back LDAP example

* Update config-options.md

* getUserID function sjhouldn't care about password

* Added LOCKOUT to INVALID_ACCOUNT_FLAGS

* Update styling approach for v-select

Co-authored-by: rijkvanzanten <rijkvanzanten@me.com>
  • Loading branch information
aidenfoxx and rijkvanzanten committed Oct 29, 2021
1 parent f3c47eb commit b7ee318
Show file tree
Hide file tree
Showing 20 changed files with 843 additions and 66 deletions.
2 changes: 2 additions & 0 deletions api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@
"keyv": "^4.0.3",
"knex": "^0.95.11",
"knex-schema-inspector": "1.6.4",
"ldapjs": "^2.3.1",
"liquidjs": "^9.25.0",
"lodash": "^4.17.21",
"macos-release": "^2.4.1",
Expand Down Expand Up @@ -186,6 +187,7 @@
"@types/json2csv": "5.0.3",
"@types/jsonwebtoken": "8.5.5",
"@types/keyv": "3.1.3",
"@types/ldapjs": "^2.2.1",
"@types/lodash": "4.14.176",
"@types/mime-types": "2.1.1",
"@types/ms": "0.7.31",
Expand Down
5 changes: 4 additions & 1 deletion api/src/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import getDatabase from './database';
import env from './env';
import logger from './logger';
import { AuthDriver } from './auth/auth';
import { LocalAuthDriver, OAuth2AuthDriver, OpenIDAuthDriver } from './auth/drivers';
import { LocalAuthDriver, OAuth2AuthDriver, OpenIDAuthDriver, LDAPAuthDriver } from './auth/drivers';
import { DEFAULT_AUTH_PROVIDER } from './constants';
import { InvalidConfigException } from './exceptions';
import { AuthDriverOptions } from './types';
Expand Down Expand Up @@ -74,5 +74,8 @@ function getProviderInstance(

case 'openid':
return new OpenIDAuthDriver(options, config);

case 'ldap':
return new LDAPAuthDriver(options, config);
}
}
1 change: 1 addition & 0 deletions api/src/auth/drivers/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
export * from './local';
export * from './oauth2';
export * from './openid';
export * from './ldap';

0 comments on commit b7ee318

Please sign in to comment.