Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Core: ServiceOptions.setCredentials fails with ClassCastException when using UserCredentials #123

Closed
vladimir-lu opened this issue Jan 9, 2020 · 1 comment · Fixed by #124
Assignees
Labels
priority: p1 🚨 type: bug

Comments

@vladimir-lu
Copy link

@vladimir-lu vladimir-lu commented Jan 9, 2020

On line

this.quotaProjectId = ((ServiceAccountCredentials) credentials).getQuotaProjectId();
the check is instanceof QuotaProjectIdProvider but the cast is to ServiceAccountCredentials therefore you get

class com.google.auth.oauth2.UserCredentials cannot be cast to class com.google.auth.oauth2.ServiceAccountCredentials (com.google.auth.oauth2.UserCredentials and com.google.auth.oauth2.ServiceAccountCredentials are in unnamed module of loader 'app')

The cast needs to be changed. google-cloud-core version 1.92.0

@chingor13 chingor13 added priority: p1 type: bug labels Jan 9, 2020
@chingor13
Copy link
Collaborator

@chingor13 chingor13 commented Jan 9, 2020

Thanks for finding this and reporting it! It's definitely a bug and we'll fix and push a release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: p1 🚨 type: bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants