Class BasicAuthenticationPolicy
- java.lang.Object
-
- io.apiman.gateway.engine.policies.AbstractMappedPolicy<BasicAuthenticationConfig>
-
- io.apiman.gateway.engine.policies.BasicAuthenticationPolicy
-
- All Implemented Interfaces:
IPolicy
public class BasicAuthenticationPolicy extends AbstractMappedPolicy<BasicAuthenticationConfig>
An implementation of an apiman policy that supports multiple styles of authentication. Specifically this policy is responsible for authenticating the inbound request prior to proxying the request to the back end API. If the authentication fails then the back end system is never invoked.- Author:
- eric.wittmann@redhat.com
-
-
Constructor Summary
Constructors Constructor Description BasicAuthenticationPolicy()Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voiddoApply(ApiRequest request, IPolicyContext context, BasicAuthenticationConfig config, IPolicyChain<ApiRequest> chain)Override this method to interact with or observe the request.Class<BasicAuthenticationConfig>getConfigurationClass()The class to use for JSON configuration deserializationprotected voidsendAuthFailure(IPolicyContext context, IPolicyChain<?> chain, BasicAuthenticationConfig config, int reason)Sends the 'unauthenticated' response as a policy failure.-
Methods inherited from class io.apiman.gateway.engine.policies.AbstractMappedPolicy
apply, apply, doApply, doProcessFailure, parseConfiguration, processFailure
-
-
-
-
Method Detail
-
getConfigurationClass
public Class<BasicAuthenticationConfig> getConfigurationClass()
The class to use for JSON configuration deserialization- Specified by:
getConfigurationClassin classAbstractMappedPolicy<BasicAuthenticationConfig>- Returns:
- the class
-
doApply
protected void doApply(ApiRequest request, IPolicyContext context, BasicAuthenticationConfig config, IPolicyChain<ApiRequest> chain)
Description copied from class:AbstractMappedPolicyOverride this method to interact with or observe the request.- Overrides:
doApplyin classAbstractMappedPolicy<BasicAuthenticationConfig>- Parameters:
request- the requestchain- the ordered policy chain- See Also:
AbstractMappedPolicy.doApply(io.apiman.gateway.engine.beans.ApiRequest, io.apiman.gateway.engine.policy.IPolicyContext, java.lang.Object, io.apiman.gateway.engine.policy.IPolicyChain)
-
sendAuthFailure
protected void sendAuthFailure(IPolicyContext context, IPolicyChain<?> chain, BasicAuthenticationConfig config, int reason)
Sends the 'unauthenticated' response as a policy failure.- Parameters:
context-chain-config-reason-
-
-