Skip to content

Commit

Permalink
Update GcAuth.kt
Browse files Browse the repository at this point in the history
  • Loading branch information
bootstraponline committed Jan 10, 2019
1 parent ac65d0d commit 00fb8c0
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions test_runner/src/main/kotlin/ftl/gc/GcAuth.kt
Expand Up @@ -46,15 +46,14 @@ object GcAuth {
// https://github.com/bootstraponline/gcloud_cli/blob/e4b5e01610abad2e31d8a6edb20b17b2f84c5395/google-cloud-sdk/lib/googlecloudsdk/core/config.py#L167
val scopes = listOf("https://www.googleapis.com/auth/cloud-platform")

// Build flow and trigger user authorization request.
val flow = GoogleAuthorizationCodeFlow.Builder(HTTP_TRANSPORT, JSON_FACTORY, CLIENT_ID, CLIENT_SECRET, scopes)
.setDataStoreFactory(DATA_STORE_FACTORY)
.setAccessType("offline")
.build()

val authCode = AuthorizationCodeInstalledApp(flow, LocalServerReceiver())
val storeKey = "default"
val dataStoreKey = "default"

return authCode.authorize(storeKey).toGoogleCredential()
return authCode.authorize(dataStoreKey).toGoogleCredential()
}
}

0 comments on commit 00fb8c0

Please sign in to comment.