question

tomassvedin avatar image
tomassvedin asked

Admin Login Visual Studio

I'm trying to create an "Admin application" for my game using Visual Studio 2015.

I have several questions regarding this.

#1 - Do I need to login using PlayFabClientAPI to be able to use PlayFabAdminAPI? Or do I only specify the TitleID and go from there?

#2 - If I need to login, can you show me how to do so since the functions differ from the ones I'm used to in Unity. For example, in Unity I use PlayFab.PlayFabClientAPI.LoginWithEmailAddress... but in the C# SDK which I'm using in Visual Studio it's called PlayFab.PlayFabClientAPI.LoginWithEmailAddressAsync.

I have no idea how to use Async in Visual Studio, I'm quite new on creating applications with it... So some simple example code would be great.

I know an admin application isn't really needed since we have the Dashboard, I'm simply doing this to learn Visual Studio and I thought this would be a good starting point since it will be useful for me... (and I can later send my application to other game-admins so they can use it instead of the Dashboard)...

1 comment
10 |1200

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

tomassvedin avatar image tomassvedin commented ·

I think I'm on to something, but it doesn't work.. yet ;-)

I tried to do as I do in Unity, using this:

LoginWithEmailAddressRequest request = new LoginWithEmailAddressRequest()
                {
                    Email = txtUsername.Text,
                    Password = txtPassword.Text
                };

                PlayFabResult<LoginResult> result = await PlayFabClientAPI.LoginWithEmailAddressAsync(request, (result) =>
                {
                    MainForm mainFrm = new MainForm();
                    mainFrm.Show();
                });
0 Likes 0 ·

1 Answer

·
brendan avatar image
brendan answered

No worries, but the Client Session Ticket (which is what you get on a client sign-in) is irrelevant in this case. The Server and Admin API calls require the Secret Key for authentication, which you get from the Settings for your title. If you have a look at the Server tests in the Unity SDK, for example, you'll see how we use the Secret Key to access the calls: https://github.com/PlayFab/UnitySDK/tree/master/Testing/Tests/Server.

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.