Intercept OkHttp request and sign AWS v4 signature
Add project root build.gradle
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
and add package build.gradle
dependencies {
...
implementation 'com.github.gyamoto:AwsSignInterceptor:master'
}
val credentialProvider = CognitoCredentialsProvider("identity pool id", Regions.AP_NORTHEAST_1)
val authInterceptor = AwsSignInterceptor(credentialProvider, AP_NORTHEAST_1)
val client = OkHttpClient.Builder()
.addInterceptor(authInterceptor)
.build()