import com.wealdtech.hawk.HawkClient
import com.wealdtech.hawk.HawkCredentials
import com.wealdtech.hawk.HawkCredentials.Algorithm
//If you want your clients to authenticate using Hawk then you will need to start with a set of Hawk credentials:
HawkCredentials hawkCredentials = new HawkCredentials.Builder()
.keyId("dh37fgj492je")
.key("werxhqb98rpaxn39848xrunpaw3489ruxnpa98w4rxn")
.algorithm(Algorithm.SHA256)
.build();
//Once these have been configuration you can create a Hawk client:
HawkClient hawkClient = new HawkClient.Builder().credentials(hawkCredentials).build();
//And then for each request that you wish to send you need to generate an authorization header:
String authorizationHeader = hawkClient.generateAuthorizationHeader(uri, method, body, ext);