Issue
I'm building an android application(no backend server) using Photos Library API , it access to google photos and manage image .
There are three step:
Im stucking with step 3
First , I create an client :
settings = PhotosLibrarySettings.newBuilder()
.setCredentialsProvider(
FixedCredentialsProvider.create(getUserCredentials(token)))
.build()
return PhotosLibraryClient.initialize(settings)
in getUserCredential method, it return a Credential:
fun getUserCredentials(token: String): Credentials? {
val a = AccessToken(token, null)
return UserCredentials.newBuilder()
.setClientId("client_id.apps.googleusercontent.com")
.setClientSecret("")
.setAccessToken(a)
.build()
}
But problem is I can't find Client Secret in Google Console, it just have Client ID. I'm tried with Json file downloaded from Console, but it doesn't have client_secret field, and it return null on this field
Question is : How to get Client Secret for Android Application, or another way to get Credential without client secret
Can I have a solution for this problem ????
Solution
I had a same issue. You don't have to use exactly client secret from Android Application. You could use client secret from Web App, and your android app still work fine
Answered By - Misecure
Answer Checked By - Mildred Charles (JavaFixing Admin)