Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into feature/mid-6303
- Loading branch information
Showing
38 changed files
with
1,299 additions
and
900 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
...n-gui/src/main/java/com/evolveum/midpoint/web/security/MidpointAuthenticationManager.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/* | ||
* Copyright (c) 2010-2019 Evolveum and contributors | ||
* | ||
* This work is dual-licensed under the Apache License 2.0 | ||
* and European Union Public License. See LICENSE file for details. | ||
*/ | ||
package com.evolveum.midpoint.web.security; | ||
|
||
import org.springframework.security.authentication.AuthenticationManager; | ||
import org.springframework.security.authentication.AuthenticationProvider; | ||
|
||
import java.util.List; | ||
|
||
/** | ||
* @author skublik | ||
*/ | ||
|
||
public interface MidpointAuthenticationManager extends AuthenticationManager { | ||
public List<AuthenticationProvider> getProviders(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
61 changes: 61 additions & 0 deletions
61
...i/src/main/java/com/evolveum/midpoint/web/security/factory/module/OtherModuleFactory.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
package com.evolveum.midpoint.web.security.factory.module; | ||
|
||
import com.evolveum.midpoint.model.api.authentication.AuthModule; | ||
import com.evolveum.midpoint.model.api.authentication.AuthenticationChannel; | ||
import com.evolveum.midpoint.util.logging.Trace; | ||
import com.evolveum.midpoint.util.logging.TraceManager; | ||
import com.evolveum.midpoint.xml.ns._public.common.common_3.AbstractAuthenticationModuleType; | ||
import com.evolveum.midpoint.xml.ns._public.common.common_3.AuthenticationModuleOtherType; | ||
import com.evolveum.midpoint.xml.ns._public.common.common_3.AuthenticationModulesType; | ||
import com.evolveum.midpoint.xml.ns._public.common.common_3.CredentialsPolicyType; | ||
|
||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.context.ApplicationContext; | ||
import org.springframework.stereotype.Component; | ||
|
||
import javax.servlet.ServletRequest; | ||
import java.util.Map; | ||
|
||
/** | ||
* Created by Viliam Repan (lazyman). | ||
*/ | ||
@Component | ||
public class OtherModuleFactory extends AbstractModuleFactory { | ||
|
||
private static final Trace LOGGER = TraceManager.getTrace(OtherModuleFactory.class); | ||
|
||
@Autowired | ||
private ApplicationContext applicationContext; | ||
|
||
@Override | ||
public boolean match(AbstractAuthenticationModuleType module) { | ||
if (module instanceof AuthenticationModuleOtherType) { | ||
return true; | ||
} | ||
|
||
return false; | ||
} | ||
|
||
@Override | ||
public AuthModule createModuleFilter(AbstractAuthenticationModuleType module, String prefixOfSequence, ServletRequest request, | ||
Map<Class<?>, Object> sharedObjects, AuthenticationModulesType authenticationsPolicy, | ||
CredentialsPolicyType credentialPolicy, AuthenticationChannel authenticationChannel) throws Exception { | ||
|
||
if (!(module instanceof AuthenticationModuleOtherType)) { | ||
LOGGER.error("This factory support only AuthenticationModuleOtherType, but module is " + module); | ||
return null; | ||
} | ||
|
||
AuthenticationModuleOtherType other = (AuthenticationModuleOtherType) module; | ||
|
||
String factoryClass = other.getFactoryClass(); | ||
|
||
Class<AbstractModuleFactory> factoryClazz = (Class) Class.forName(factoryClass); | ||
AbstractModuleFactory factory = applicationContext.getBean(factoryClazz); | ||
|
||
AuthModule authModule = factory.createModuleFilter(module, prefixOfSequence, request, sharedObjects, | ||
authenticationsPolicy, credentialPolicy, authenticationChannel); | ||
|
||
return authModule; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.