I was encountering NullPointer exceptions when updating the play-googleauth version in our project.
I might be doing something wrong but it seems to me like the deprecated GoogleGroupChecker constructor that takes a GoogleServiceAccount doesn't build an equivalent ServiceAccountCredentials properly.
It sets privateKey and serviceAccountUser`:
|
def this(googleServiceAccount: GoogleServiceAccount) = { |
|
this( |
|
googleServiceAccount.impersonatedUser, |
|
ServiceAccountCredentials.newBuilder() |
|
.setPrivateKey(googleServiceAccount.privateKey) |
|
.setServiceAccountUser(googleServiceAccount.email) |
|
.build() |
|
) |
|
} |
But the GoogleServiceAccount class requires clientEmail to be set (see code here )
It might be that we just should be setting clientEmail instead of, or in addition to serviceAccountUser I'm not sure what the difference is exactly.
I just refactored my code to not use this method anyway so It's not blocking anything on my side.
I was encountering NullPointer exceptions when updating the
play-googleauthversion in our project.I might be doing something wrong but it seems to me like the deprecated GoogleGroupChecker constructor that takes a
GoogleServiceAccountdoesn't build an equivalentServiceAccountCredentialsproperly.It sets privateKey and serviceAccountUser`:
play-googleauth/play-v27/src/main/scala/com/gu/googleauth/groups.scala
Lines 61 to 69 in d60875f
But the
GoogleServiceAccountclass requires clientEmail to be set (see code here )It might be that we just should be setting clientEmail instead of, or in addition to serviceAccountUser I'm not sure what the difference is exactly.
I just refactored my code to not use this method anyway so It's not blocking anything on my side.