question

brendan avatar image
brendan asked

How do i get OAuth 2.0?

marcusmingoransi
started a topic on Tue, 03 March 2015 at 5:36 AM

Hello folks,

How do i get OAuth 2.0 for logging GamePlay with Playfab?

using GooglePlayGames;



private string m_AccessToken;



    public void Login()

    {

        LoginWithGoogleAccountRequest request = new LoginWithGoogleAccountRequest();



        request.AccessToken = m_AccessToken;

        request.CreateAccount = true;

        request.TitleId = PlayFabData.TitleId;



        PlayFabClientAPI.LoginWithGoogleAccount(request, onLoginResult, LoginError);

    }



    public void GetAuthToken()

    {

        //m_AccessToken =

    }
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
brendan avatar image
brendan answered

Best Answer
zacb said on Tue, 03 March 2015 at 10:54 PM

Hey Marcus,
John's link provides a lot of good information. I wanted to highlight that this part from the thread:

  • brendanv said:
  • You are correct that the Google Play Services plugin does not provide direct access to the auth token. The authentication token to be used for Google sign-in to PlayFab is the one-time authorization code retrieved from a call to getToken in the GoogleAuthUtil class. The refresh token isn't necessary in this flow, so you don't need to worry about that.

Additionally, when I get back from GDC, I will be syncing up with our engineers and wrapping up the last remaining work on our log in flow sample code. This will provide some guidance on how to use each of authentication pathways; as well as offciailly introduce our new android plugin.

-Zac


4 Comments
marcusmingoransi said on Tue, 03 March 2015 at 6:18 AM

I created a project on Google developers console, it returns me a json file, clientID, Secret Key and REDIRECT URIs, which of these should I use as auth token?


johntube said on Tue, 03 March 2015 at 8:12 AM

What you need is hard work.

start here


zacb said on Tue, 03 March 2015 at 10:54 PM

Hey Marcus,
John's link provides a lot of good information. I wanted to highlight that this part from the thread:

  • brendanv said:
  • You are correct that the Google Play Services plugin does not provide direct access to the auth token. The authentication token to be used for Google sign-in to PlayFab is the one-time authorization code retrieved from a call to getToken in the GoogleAuthUtil class. The refresh token isn't necessary in this flow, so you don't need to worry about that.

Additionally, when I get back from GDC, I will be syncing up with our engineers and wrapping up the last remaining work on our log in flow sample code. This will provide some guidance on how to use each of authentication pathways; as well as offciailly introduce our new android plugin.

-Zac


johntube said on Fri, 06 March 2015 at 6:50 PM

A new Android plugin is announced ! More good news.

I hope the new version will include Google+ authentication (connection/disconnection, revoke access, error handling, getting token). I don't know if it should also enable getting Google+'s public profile info [google name, profile picture URL, etc.] since it's still not exposed with PlayFab API (UserAccountInfo result).

One other thing : I think SendPushNotification should have some "private" field that will contain data sent to registered devices but will be hidden to the user, like gameId for a TurnBased game where the opponent just made a move. I'm mentioning this here because this will impact the GcmMessageCallback in the Android plugin as this "private" field should be handled separately !

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.