protected boolean isDelegatedClientAuthorizedForService ( final Client client , final Service service ) { if ( service == null || StringUtils . isBlank ( service . getId ( ) ) ) { LOGGER . debug ( "Can not evaluate delegated authentication policy since no service was provided in the request while processing client [{}]" , client ) ; return true ; } val registeredService = this . servicesManager . findServiceBy ( service ) ; if ( registeredService == null || ! registeredService . getAccessStrategy ( ) . isServiceAccessAllowed ( ) ) { LOGGER . warn ( "Service access for [{}] is denied" , registeredService ) ; return false ; } LOGGER . trace ( "Located registered service definition [{}] matching [{}]" , registeredService , service ) ; val context = AuditableContext . builder ( ) . registeredService ( registeredService ) . properties ( CollectionUtils . wrap ( Client . class . getSimpleName ( ) , client . getName ( ) ) ) . build ( ) ; val result = delegatedAuthenticationPolicyEnforcer . execute ( context ) ; if ( ! result . isExecutionFailure ( ) ) { LOGGER . debug ( "Delegated authentication policy for [{}] allows for using client [{}]" , registeredService , client ) ; return true ; } LOGGER . warn ( "Delegated authentication policy for [{}] refuses access to client [{}]" , registeredService . getServiceId ( ) , client ) ; return false ; }
Is delegated client authorized for service boolean .