Karel Piwko commented on Feature Request AGSEC-81

According to CDI specification

It is required to haver HawkServer and HawkCredentialsProvider bean producers in the archive if you add AGSEC core to the deployment.

Something like

 @Produces
    public HawkServer createHawkServer() {
        HawkServerConfiguration configuration = new HawkServerConfiguration.Builder().build();
        return new HawkServer.Builder().configuration(configuration).build();
    }
 
    @Produces
    public HawkCredentialProvider createHawkCredentialProvider() {
 
        return new HawkCredentialProvider() {
 
            @Override
            public HawkCredentials findByKey(String arg0) {
                HawkCredentials credentials = new HawkCredentials.Builder()
                    .keyId("dh37fgj492je")
                    .key("werxhqb98rpaxn39848xrunpaw3489ruxnpa98w4rxn")
                    .algorithm(HawkCredentials.Algorithm.SHA256)
                    .build();
                return credentials;
            }
        };
    }

Another solution is to make AGSEC modular and aerogear-security-hawk module will be added as dependency at will only if developer is indeed indenting to use Hawk and then it would be his responsibility to create producers.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira