Custom Authenticator Configuration - ProviderConfigProperty.FILE_TYPE

206 views
Skip to first unread message

Jason DeLawder

unread,
Sep 11, 2020, 3:26:42 PM9/11/20
to Keycloak User
I'm working on a project that needs to plugin to the AuthenticationFlow and invoke a webservice that requires mutual authentication.  This would be server peer authentication, not client authentication.  Within the admin console, I would like the plugin to allow someone to upload a trusted CA certificate (in the event the target server is using something like an Active Directory Domain CA) and a client certificate key pair for the Keycloak server signed by the same CA.

I have added the FILE_TYPE to my configuration properties, but when I navigate to the config screen within the execution, the label is present, but not the form field.

As an alternative, I can use text fields and paste the certificate hashes.  That would require a few extra lines of code and not quite as user friendly, but will go that route if necessary.

Below is my ProviderConfigProperty and the resulting HTML.  Is the code below incomplete?  Is there an additional model or interface I need to implement before FILE_TYPE will work?  Is FILE_TYPE an "in-progress" feature?

  ProviderConfigProperty trustedCertificate = new ProviderConfigProperty();
        trustedCertificate.setType(ProviderConfigProperty.FILE_TYPE);
        trustedCertificate.setName("trustedCertificate");
        trustedCertificate.setLabel("Trusted Certificate");
        trustedCertificate.setHelpText("Certificate identifying the target server, or trusted CA.");      
        trustedCertificate.setDefaultValue(null);          
        configProperties.add(trustedCertificate); 


<div data-ng-repeat="option in properties" class="form-group ng-scope" data-ng-controller="ProviderConfigCtrl">
        <label class="col-md-2 control-label ng-binding ng-scope">Trusted Certificate <i class="fa fa-question-circle text-muted ng-scope" tooltip="Certificate identifying the target server, or target server's CA as a trusted identity." tooltip-placement="right" tooltip-trigger="mouseover mouseout"></i></label>
        <!-- ngIf: option.type == 'String' -->
        <!-- ngIf: option.type == 'Password' -->
        <!-- ngIf: option.type == 'boolean' -->
        <!-- ngIf: option.type == 'List' -->
        <!-- ngIf: option.type == 'Role' -->
        <!-- ngIf: option.type == 'ClientList' -->
        <!-- ngIf: option.type == 'Script' -->
        <!-- ngIf: option.type == 'MultivaluedString' -->
        <!-- ngIf: option.type == 'Text' -->
        <!-- ngIf: option.type == 'Map' -->
        <kc-tooltip class="hidden"></kc-tooltip>
    </div>  

Best Regards,

Jason

The Vee

unread,
Feb 4, 2021, 11:14:26 AM2/4/21
to Keycloak User
HI Jason,
Did you find any workaround to achieve the FILE_TYPE providerConfigProperty. I am also stuck with that.

Thanks

Rakesh Patil

unread,
Aug 27, 2021, 12:03:35 PM8/27/21
to Keycloak User
Hello,

Wondering if you found the fix for an issue?

Thank You!
Rakesh

Message has been deleted

Jason DeLawder

unread,
Oct 21, 2021, 2:19:32 PM10/21/21
to Keycloak User
I went with the alternative that I suggested of using the PEM text of the certificates and transforming them and writing to an in memory certificate store held by the plugin.

Jason DeLawder

unread,
Oct 21, 2021, 2:19:39 PM10/21/21
to Keycloak User
I went with the alternative that I suggested of using the PEM text of the certificates and transforming them and writing to an in memory certificate store held by the plugin.

Reply all
Reply to author
Forward
0 new messages