Java Code Examples for org.apache.cxf.configuration.security.AuthorizationPolicy#getAuthorizationType()

The following examples show how to use org.apache.cxf.configuration.security.AuthorizationPolicy#getAuthorizationType() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: CustomAuthSupplier.java    From cxf with Apache License 2.0 5 votes vote down vote up
public String getAuthorization(AuthorizationPolicy  authPolicy,
                               URI currentURI,
                               Message message,
                               String fullHeader) {
    if (authPolicy.getAuthorizationType() != null && authPolicy.getAuthorization() != null) {
        return authPolicy.getAuthorizationType() + " " + authPolicy.getAuthorization();
    }
    return null;
}
 
Example 2
Source File: HTTPConduit.java    From cxf with Apache License 2.0 5 votes vote down vote up
private HttpAuthSupplier createAuthSupplier(AuthorizationPolicy authzPolicy) {
    String authType = authzPolicy.getAuthorizationType();
    if (HttpAuthHeader.AUTH_TYPE_NEGOTIATE.equals(authType)) {
        return new SpnegoAuthSupplier();
    } else if (HttpAuthHeader.AUTH_TYPE_DIGEST.equals(authType)) {
        return new DigestAuthSupplier();
    } else if (authType != null && !HttpAuthHeader.AUTH_TYPE_BASIC.equals(authType)
        && authzPolicy.getAuthorization() != null) {
        return new CustomAuthSupplier();
    } else {
        return new DefaultBasicAuthSupplier();
    }
}