Comments (5)
The above code has been integrated into the project.
Thanks @Gorbas
from spring-social-google.
I don't think this is correct. User id is not the same as username. The username can change whereas the user id cannot. This will be a problem if you are planning to store the data keyed by the user id.
The above code also causes the Connection.getKey().getProviderUserId()
to return different values depending on what scopes you have requested. If you don't have the https://www.googleapis.com/auth/userinfo.email scope getUsername()
will return null and the default initialization sequence will take place instead (see below).
The code should work without implementing extractProviderUserId()
since the user id will by default be initialized in AbstractConnection.initKey()
from spring-social-google.
@boberj's comment is correct - Connecton.getKey().getProviderUserId()
does indeed return different values depending on the requested scope. That makes it very difficult to use the API out of the box and expect consistent results. Is there a way around this behavior?
from spring-social-google.
Ping? This is a pretty big issue for us and our use of this library. I'd hope getProviderUserId() could return the numerical user id as described by @azpublic in #41 ?
from spring-social-google.
I worked around this as follows:
Google google = (Google)connection.getApi();
String uid = google.userOperations().getUserInfo().getId();
from spring-social-google.
Related Issues (20)
- Get a release out the door! HOT 12
- Is it possible to return drive files in sorted order?
- 1.2.x Release Tracking
- add support for google people api HOT 1
- New release for Maven repository? HOT 1
- Question: Google+ sunsetting effects? HOT 12
- Can we have the latest release 1.1.3 deployed to maven central as 1.1.3.RELEASE HOT 1
- Account email null after fetchUserProfile()
- Google Plus Api 'Person' Class Bug HOT 3
- I/O Error Attempted read from closed stream.
- Google OAuth2 Authorization error
- build fails HOT 3
- Add support for download exported files from google docs
- Tag and release from Maven Central HOT 9
- Add field circledByCount on Person.java class
- Photo quality is extremely low
- Asking for refresh_token and dealing with fetching new access_token when it expired HOT 1
- google.plusOperations().getGoogleProfile() throws a 403 exception after successful OAuth2 login HOT 1
- Update Jackson to 2.6+ to be compatible with Spring 4.3.5
- Missing UrlType enum constant WEBSITE
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from spring-social-google.