Skip to content

Instantly share code, notes, and snippets.

@pjwelcome
Created December 15, 2018 07:04
Show Gist options
  • Save pjwelcome/169aecc478a7e62d116762b9b5fc6b5f to your computer and use it in GitHub Desktop.
Save pjwelcome/169aecc478a7e62d116762b9b5fc6b5f to your computer and use it in GitHub Desktop.
val headerAuthorizationInterceptor = Interceptor() {
var request = it.request()
val headers = request.headers().newBuilder().add("Authorization","Bearer Enter Service Account Token here").build()
request = request.newBuilder().headers(headers).build()
return@Interceptor it.proceed(request)
}
httpClientBuilder.addInterceptor(headerAuthorizationInterceptor)
okHttpClient = httpClientBuilder.build()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment