CB-1061 SAML authorization

This commit is contained in:
serge-rider
2021-06-18 20:11:19 +03:00
parent bed84502c8
commit 46042e1ce6
2 changed files with 21 additions and 0 deletions
@@ -45,6 +45,17 @@ public interface DBWAuthProviderExternal<AUTH_SESSION extends DBASession> extend
@NotNull Map<String, Object> authParameters // Passed auth parameters (e.g. user name or password)
) throws DBException;
/**
* Returns new identifying credentials which can be used to find/create user in database
*/
@NotNull
Map<String, Object> authFederatedUser(
@NotNull DBRProgressMonitor monitor,
@NotNull Map<String, Object> providerConfig, // Auth provider configuration (e.g. 3rd party auth server address)
@NotNull String faProvider,
@NotNull Map<String, Object> faParameters // Passed federated auth parameters (e.g. assertion ID, session token, etc)
) throws DBException;
/**
* Validates that external user may be associated with local user
* @param userCredentials credentials from authExternalUser
@@ -18,9 +18,14 @@ package io.cloudbeaver.auth.provider;
import io.cloudbeaver.DBWAuthProviderExternal;
import io.cloudbeaver.model.user.WebUser;
import org.jkiss.code.NotNull;
import org.jkiss.dbeaver.DBException;
import org.jkiss.dbeaver.model.access.DBASession;
import org.jkiss.dbeaver.model.runtime.DBRProgressMonitor;
import org.jkiss.utils.CommonUtils;
import java.util.Map;
/**
* Abstract external auth provider
*/
@@ -34,4 +39,9 @@ public abstract class AbstractExternalAuthProvider<SESSION extends DBASession> i
}
}
@NotNull
@Override
public Map<String, Object> authFederatedUser(@NotNull DBRProgressMonitor monitor, @NotNull Map<String, Object> providerConfig, @NotNull String faProvider, @NotNull Map<String, Object> faParameters) throws DBException {
throw new DBException("Federated authorization not supported");
}
}