Skip to content

gyamoto/AwsSignInterceptor

Repository files navigation

AwsSignInterceptor

Intercept OkHttp request and sign AWS v4 signature

jitpack

Download

Add project root build.gradle

allprojects {
    repositories {
        ...
        maven { url 'https://jitpack.io' }
    }
}

and add package build.gradle

dependencies {
    ...
    implementation 'com.github.gyamoto:AwsSignInterceptor:master'
}

Usage

val credentialProvider = CognitoCredentialsProvider("identity pool id", Regions.AP_NORTHEAST_1)

val authInterceptor = AwsSignInterceptor(credentialProvider, AP_NORTHEAST_1)

val client = OkHttpClient.Builder()
    .addInterceptor(authInterceptor)
    .build()