Skip to content
This repository has been archived by the owner on Sep 21, 2021. It is now read-only.

plus.me scope does not return email of user #119

Open
alirezastack opened this issue Dec 30, 2018 · 2 comments
Open

plus.me scope does not return email of user #119

alirezastack opened this issue Dec 30, 2018 · 2 comments

Comments

@alirezastack
Copy link

The problem I faced is that when a token is generated based on plus.me and that token is given to google via our server. The token does not return user email address:

/**
     * Register Google Implicit OAuth.
     * If overrides is left empty, the default scope is limited to basic profile information.
     *
     * @param {string} clientId ClientID for the Google App.
     * @param {object} config Valid Endpoint configuration to override the defaults.
     * @return {object} Returns the added endpoint.
     */
    EndpointStorage.prototype.registerGoogleAuth = function (clientId, overrides) {
        var defaults = {
            clientId: clientId,
            baseUrl: 'https://accounts.google.com',
            authorizeUrl: '/o/oauth2/v2/auth',
            resource: 'https://www.googleapis.com',
            responseType: 'token',
            scope: 'https://www.googleapis.com/auth/plus.profile.emails.read',
            **// scope: 'https://www.googleapis.com/auth/plus.me',**
            state: true
        };
        var config = __assign({}, defaults, overrides);
        return this.add(DefaultEndpoints.Google, config);
    };

I changed plus.me to plus.profile.emails.read and I could get user's email address. Why this scope is set and is there any chance to change this scope to plus.profile.emails.read?

@alirezastack alirezastack changed the title plus.me scope does not return does not return email of user plus.me scope does not return email of user Dec 30, 2018
@sumurthy
Copy link
Contributor

Could you clarify if this is Office-js-helpers related? When you say you couldn't get the email address back, can you specify where you are unable to receive?

@alirezastack
Copy link
Author

@sumurthy yes it is related to office.js helpers. I have provided the code from office library and based on the scope in office-js helpers it gives a token that return insufficient account information.

For now I use the below scope to get user email address and name:

https://www.googleapis.com/auth/ plus.me https://www.googleapis.com/auth/userinfo.profile https://www.googleapis.com/auth/userinfo.email

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants