5 Commits

Author SHA1 Message Date
Roger Stringer
53a3194d5c Add support for SAML Part 2 (#16145)
* new saml branch

* put saml info back in

* put saml info back in

* clean up code

* validate saml config

* validate schema

* Add saml auth flow tests

* use RelayState for redirects

* Update tests for RelayState

* Fix linting

* remove validateMeta as samlify does it already

* Fix linting

* change catch on login

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

Co-authored-by: Aiden Foxx <aiden.foxx.mail@gmail.com>

* remove login since not needed here

* clear cookie if set on logout

* empty login method

* invalidate logout in db

* if relayState and login failed, redirect back with a reason

* Cleanup linter warnings

* Remove range from packages

* Opinions opinions opinions opinions

Just a couple personal opinion cleanup pieces

Co-authored-by: ian <licitdev@gmail.com>
Co-authored-by: Aiden Foxx <aiden.foxx.mail@gmail.com>
Co-authored-by: rijkvanzanten <rijkvanzanten@me.com>
2022-11-01 22:09:31 +00:00
Dorian Zedler
94e53212b4 Implement AUTH_DISABLE_DEFAULT config option (#9322)
* Implement AUTH_DISABLE_DEFAULT config option

* Disable default auth rute if set to disabled

* Add disableDefault to API docs

* Update app/src/routes/login/login.vue

Co-authored-by: Aiden Foxx <aiden.foxx.mail@gmail.com>

* Remove watch block

* Remove useless variable

* Don't import watch

Co-authored-by: Aiden Foxx <aiden.foxx.mail@gmail.com>
Co-authored-by: rijkvanzanten <rijkvanzanten@me.com>
2021-12-03 14:13:50 -05:00
Aiden Foxx
b7ee318e43 LDAP auth provider (#9074)
* 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>
2021-10-29 11:58:10 -04:00
Aiden Foxx
fa3b1171e8 New OpenID and OAuth2 drivers (#8660)
* Moved over oauth impl to new interface

* Fixed most build issues and started addind schema to auth drivers

* Finished up OAuth2 and OpenID drivers

* Removed unused migration and utils

* Fixed minor todos

* Removed old oauth flow

* Changed oauth flow to re-use refresh token

* Added new oauth frontend

* Added font awesome social icons

* Updated authentication documentation

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

* Tested implementation and fixed incorrect validation

* Updated docs

* Improved OAuth error handling and re-enabled creating users with provider/identifier

* Removed Session config from docs

* Update app/src/components/v-icon/v-icon.vue

* Removed oauth need to define default roleID

* Added FormatTitle to SSO links

* Prevent local auth without password

* Store OAuth access token in session data

* Update docs/guides/api-config.md

* Fixed copy and removed fontawesome-vue dependency

* More docs fixes

* Crucialy importend type fiks

* Update package-lock

* Remove is-email-allowed check

In favor of more advanced version based on filtering coming later

* Fix JSON type casting

* Delete unused util

* Update type signature to include name

* Add warning when code isn't found in oauth url

and remove obsolete imports

* Auto-continue on successful SSO login

* Tweak type signature

* More type casting shenanigans

* Please the TS gods

* Check for missing token before crashing

Co-authored-by: rijkvanzanten <rijkvanzanten@me.com>
2021-10-21 17:45:01 -04:00
Aiden Foxx
084c6117b7 Modular authentication (#6942)
* Moved refactoring from LDAP branch

* Moved Auth into packages

* Updated frontend to support custom auth providers and make implementation more flexible

* Fixed exception handling and numerous bugs. Also added provider support to graphql

* Updated frontend to be able to set provider and identifier

* Fixed issue with setting the auth provider in app

* Updated package-lock.json

* Updated package-lock.json

* Cleanup, adding type handling and disabled changing provider

* Added title formatting to SSO links

* Fixed incorrect type export

* Fixed incorrect rc

* Update api/src/services/authentication.ts

* Updated sub-dependencies to rc87

* Fixed linting errors

* Prefer sending provider name as config var

* Pass clone of user info to auth provider instead of reference

* Moved auth from packages into core

* Removed generic login handler

* Fixed graphql complaint

* Moved exception back to api and cleaned up URLs

* Minor tweak

* Pulled across improvements from openid branch

* Fixed fix that wasn't a fix

* Update auth.ts

* Update auth.ts

* Update authentication.ts

* Update login-form.vue

* Regression fixes and cleanup

* Minor flow improvements

* Flipped if and fixed linting warning

* Un-expanded object that didn't need to be expanded!

* Trimmed auth interface for consistency when verifying passwords

* Removed auth-manager, changed login endpoint, broke out SSO links, removed username support, disabled updating external_identifier, generate provider options as part of field generation

* Cleaned up some code comments

* Use named exports in local driver

* Use async defaults for auth abstract class

* Use JSON for auth_data field

* Move session data blob to directus_sessions

* Remove unused export, rename auth->authDriver

* Opinionated changes

* Move login route registration to driver file

* Revert app changes in favor of PR #8277

* Send session token to auth provider and opinionated changes

* Added missing translation

* Fixed empty elements for users without email

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

* Move pw verify to local driver, remove CRUD

* Opinions > logical reasoning

* Use session data, cleanup login method on auth serv

* Remove useless null

* Fixed breaking changes from refactor, and fixed build

* Fixed lint warning

* Ignore typescript nonsense

* Update api/src/services/authentication.ts

* Fix provider name passthrough

Co-authored-by: Aiden Foxx <aiden.foxx@sbab.se>
Co-authored-by: Rijk van Zanten <rijkvanzanten@me.com>
2021-09-27 17:18:20 -04:00