Skip to content

Inconsistency in permissions #51

Closed
@Ricardo1980

Description

@Ricardo1980

My app uses 2 permissions, public_profile and email.

I set up them using:

<string-array name="my_facebook_permissions" translatable="false">
        <item>public_profile</item>
        <item>email</item>
    </string-array>

and

<meta-data
                android:name="com.parse.ui.ParseLoginActivity.FACEBOOK_LOGIN_PERMISSIONS"
                android:resource="@array/my_facebook_permissions" />

I see the native and web dialog properly, asking the user these 2 permissions. I also see in the debugger that those 2 permissions are passed properly to facebook.

This is what I see in the debugger inside FacebookAuthentificationProvider, authenticateAsync, accessToken (it seems right, well, I see contact_email, but it doesn't matter)

captura de pantalla 2015-08-03 a las 13 28 01

But if I continue with the debugging... once in my app, after the login, in onActivityResult, if I call
AccessToken accessToken=AccessToken.getCurrentAccessToken();

I see that that access token doesn't have granted permissions or rejected permissions (they are empty), but if I use GraphRequest I can get the user email with String emailFromFacebook = object.optString("email"); without problems.

captura de pantalla 2015-08-03 a las 13 14 49

It doesn't make any sense that those permission variables have different values in those places.

BTW I'm using ParseUI and facebook sdk version 4.0.1

Apart from that, if I reject the email permission in the login dialog, I see inside FacebookAuthentificationProvider that has been rejected by the user:

captura de pantalla 2015-08-03 a las 13 45 01

However, in my app code, in onActivityResult, I see exactly the same than the other case... just nothing, no granted or declined permissions, so accessToken.getDeclinedPermissions().contains("email") is completely useless and when I try to get the user email like before, I receive null (probably because the app doesn't have permission).

captura de pantalla 2015-08-03 a las 14 13 08

I guess this behavior is not normal. BTW I'm supposing that accesstoken.permissions contains granted permissions and accesToken.declinedPermissions contains declined permissions, is that right?

Thanks in advance.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions