com.gu.googleauth.internal.DirectoryService.scala Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of play-v28_2.13 Show documentation
Show all versions of play-v28_2.13 Show documentation
Simple Google authentication module for the Play web framework
The newest version!
package com.gu.googleauth.internal
import com.google.api.client.googleapis.javanet.GoogleNetHttpTransport
import com.google.api.client.json.gson.GsonFactory
import com.google.api.services.directory.Directory
import com.google.auth.http.HttpCredentialsAdapter
import com.google.auth.oauth2.GoogleCredentials
object DirectoryService {
def apply(googleCredentials: GoogleCredentials, scope: String): Directory = {
val credentials = googleCredentials.createScoped(scope)
val transport = GoogleNetHttpTransport.newTrustedTransport()
val jsonFactory = GsonFactory.getDefaultInstance
new Directory.Builder(transport, jsonFactory, new HttpCredentialsAdapter(credentials))
.setApplicationName("play-googleauth").build()
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy