feat: add ldap external idp to login api (#5938)

* fix: handling of ldap login through separate endpoint

* fix: handling of ldap login through separate endpoint

* fix: handling of ldap login through separate endpoint

* fix: successful intent for ldap

* fix: successful intent for ldap

* fix: successful intent for ldap

* fix: add changes from code review

* fix: remove set intent credentials and handle ldap errors

* fix: remove set intent credentials and handle ldap errors

* refactor into separate methods and fix merge

* remove mocks

---------

Co-authored-by: Livio Spring <livio.a@gmail.com>
This commit is contained in:
Stefan Benz
2023-08-16 13:29:57 +02:00
committed by GitHub
parent 1b923425cd
commit 52f68f8db8
27 changed files with 726 additions and 149 deletions

View File

@@ -26,6 +26,7 @@ type Session struct {
loginUrl string
User string
Password string
Entry *ldap.Entry
}
func (s *Session) GetAuthURL() string {
@@ -57,6 +58,7 @@ func (s *Session) FetchUser(_ context.Context) (_ idp.User, err error) {
if err != nil {
return nil, err
}
s.Entry = user
return mapLDAPEntryToUser(
user,